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.

Leave a Reply

Show Buttons
Hide Buttons
Read previous post:
Access External Storage With These Helper Functions For Delphi XE7 Firemonkey On Android

Developer Ray Vecchio has released some helper functions which makes accessing the external storage on Android in Delphi XE7 Firemonkey...