Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetDelphiFiremonkey

Code Snippet To Set The Device Wallpaper In Delphi XE7 Firemonkey On Android

Delphi XE7 Firemonkey Android Wallpaper Code SnippetDeveloper Todd Frankson has posted a code snippet for setting the device wallpaper in Android with Delphi XE7 Firemonkey. The original post is on the Embarcadero Forum but I have duplicated it here. Android has a class called the WallpaperManager which allows you to set the system wallpaper and the code uses this class. Additionally the code uses the Android BitmapFactory class. Todd recommends using the Java2op tool to generate the necessary files but you can also access the Object Pascal wrapper code for WallpaperManager on Github as well (and BitmapFactory). The code is pretty straightforward. A TImageViewer is used to save a JPEG out to the filesystem. The JPEG is loaded into the BitmapFactory and then the bitmap is set via the WallpaperManager. This code should also work with Appmethod. Here is the code snippet:

Head over and see the post on the Embarcadero forum for Delphi XE7 Firemonkey on Android.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
AndroidC++BuilderCode SnippetDelphiDemoFiremonkeyIOSOSXShowcaseWindows

Powerful Cross Platform Email App Sample In Delphi 10.4.1 FireMonkey For Android And IOS

AndroidC++BuilderDelphiFiremonkeyIOSOSXWindows

Significant Update Available For Delphi FireMonkey 10.4.1 On Android, IOS, OSX, Windows, And Linux

C++BuilderDelphiIDEWindows

Professional SVG Icon Image List For Delphi 10.4 FireMonkey On Windows

AndroidC++BuilderDelphiFiremonkeyIOSLiveBindingsOSXWindows

Top Tips And Tricks To Speed Up Development With Delphi 10.4 FireMonkey On Android and IOS

Sign up for our Newsletter and
stay informed

Leave a Reply