0

I'm planning to release a nice clock widget and I'd like to include a pretty wallpaper with it (want to do this because previously got some comments like "can i get the matching wallpaper? ;)")

So I tried to google on how to put some image file inside apk so that it would appear in wallpapers selection list after installation. I mean the list which appears when doing Home=>Menu=>Wallpaper=>Wallpaper Gallery or Pictures - whatever.

So far didn't find any hints, so decided to try to ask here.

Any hints on how to do that?

Cristian
  • 198,401
  • 62
  • 356
  • 264
dimsuz
  • 8,969
  • 8
  • 54
  • 88

1 Answers1

1

You could package the wallpaper in res/raw, and then when your app fires up for the first time, attempt to copy it to the sdcard directory /media/pictures.

You should be using methods such as getExternalStorageDirectory or getExternalStoragePublicDirectory (depending on the API level) to open the file.

http://developer.android.com/guide/topics/data/data-storage.html#filesExternal

Cylindric
  • 5,858
  • 5
  • 46
  • 68