I am developing a live wallpaper that reproduces an animation (like a short video) on background.
Does anyone know how to efficiently load various full screen size bitmaps and draw them on canvas? I have tried 2 approaches and both are not very good.
Approach #1: Load all bitmaps on wallpaper startup.
Problem: Memory excess limit (about 35MB) cant load more than 10 bitmaps. So animations lack of different images.
Approach #2: Load only 2 bitmaps. On run time, paint bitmap, delete old bitmap, load new bitmap, repeat.
Problem: Consumes a lot of the system, (not memory, but slows down os in general), however it works because it doesn't exceed memory limit. But still, slows down the entire system.
example:
Drawer.drawAll(res,c,p);
res.removeOldBitmaps();
res.loadNewBitmaps(wpservice,display);
A different approach i thought about is load resource on a separete thread, what do you guys think of that? do you have any other solutions?
Cheers!