3

I'm trying to create a live wallpaper which uses the current device wallpaper as its background.

You can see a good example of it in the 'Bubbles' live wallpaper, which does exactly what I need.

I have tried using transparent canvas but no luck.

Any idea / reference / sample would be much apprichiated.

Thanks a lot,

E.

Erez
  • 156
  • 2
  • 4

1 Answers1

3

You can try using the WallpaperManager to get the current wallpaper, save it to a file and them use it as a background on your live wallpaper. Not sure this is gonna work though.

renam.antunes
  • 761
  • 1
  • 5
  • 11
  • 1
    I like this idea (transparent canvas cannot work--you must use the supplied canvas). Maybe use peekDrawable() to get the wp's drawable and then .draw(c) where c is the canvas you get by locking the surface holder? – George Freeman Jul 09 '11 at 17:18
  • 1
    Thanks for your input. I've tried this approach but the problem is that I get a drawable for the all wallpaper rather than the current frame the user is currently seeing. Any ideas how to get the current frame? – Erez Jul 09 '11 at 17:48
  • Can't you recreate the frames when the user scrolls through his home screens? This way, you just need the Drawable for the whole walpaper. – renam.antunes Jul 09 '11 at 19:48
  • How can I do it? do you have any example or a reference? – Erez Jul 10 '11 at 06:11
  • @Erez Try saving xPixels in xOffsetsChanged and translating your canvas. See my answer here: http://stackoverflow.com/questions/6573451/onoffsetschanged-move-bitmap/6574649 – George Freeman Jul 10 '11 at 22:29