8

Is there a way to programatically get all the android system wallpapers?

I know how to get the current one, via WallpaperManager, and then save it to disk. But I want to know if there is a way to access all the pictures that act as system wallpaper included with the O.S.

Matt
  • 74,352
  • 26
  • 153
  • 180
Ton
  • 9,235
  • 15
  • 59
  • 103
  • 1
    You must clarify your question: "all the pictures that act as system wallpaper". As there can be only one system wallpaper active at a time, this might not be your question. If your question is how to list all POSSIBLE wallpapers you must specify what makes a image a wallpaper, otherwise you can simply take a list of all images on the phone. – theomega May 21 '12 at 20:48
  • Android comes with a Wallpaper application by default. Its pictures to use as wallpapers are not files in the sd card. They are resources in the apk, instead. I want to access them by code. Thanks. – Ton May 22 '12 at 05:02

2 Answers2

4

All the wallpapers are located in the launcher app. As the name of the launcher and its resources may vary accross devices, there is no way to create a reliable way to do this.

On stock Android the wallpapers are located in Launcher2.apk:res/drawable-somedpi. On my devices they were in the drawable-hdpi folder, but this may be different on others.

First get the resources of the launcher (com.android.Launcher2.apk) as described in this answer.

Then you can list the resources, using a method similar to the one in this question.

I haven't tried out all this myself, so it might not work as expected.

Community
  • 1
  • 1
Thomas
  • 1,508
  • 2
  • 22
  • 35
  • You can install wallpapers and remove then independent of the launcher. So inspecting the launchers package does not help! – theomega May 21 '12 at 20:47
  • If you decompile the Launcer2.apk with apktool, you will see it contains the wallpapers. I'm not totaly sure what you mean by 'installing a wallpaper'. – Thomas May 21 '12 at 22:07
  • Thanks for pointing me in a direction. I'm able to get a `Resources` for `com.android.launcher` (API level 7), but listing files in `res` dir returns nothing. I'll keep trying. – André May 24 '12 at 12:51
-3

Just figure out where they are saved and access them that way.

GreekOphion
  • 388
  • 6
  • 20