I have had the same difficult problem in the last few week. I can successfully load 1900 x 1200 bitmaps into my wallaper, but changing images brings outOfMemory errors. This is because when your wallpaper is running it creates a wallaper engine and if you go to its setting then on many androids will create the second PREVIEW engine, so your app will take twice as much memory!
This combined with slow garbage collector (GC) when loading new images will create outOfMemory errors.
The solution I've found is to stop and unload all images from the first engine when the second, preview is started using
bitmap.recyle();
bitmap = null;
System.gc();
try {
synchronized (this){
wait(200);
}
} catch (InterruptedException e) {
}
You need to notify the first engine to stop animation first by creating a boolean preference for that purpose so that engine 1 detects it in onSharedPreferenceChanged and stop its doDraw loop, then you clean up its images. In onCreate in the engine class you can detect if it is a preview mode:
boolean isPreview = this.isPreview();
I am not sure if wait(200) really helps but in theory it should give more time to the system to do its GC... anyway I managed to get rid of outOfmemoryError even on Sony xPeria which is really prone to this type of errors like crazy.
Also, you must avoid creating bitmaps in your animation loop, that is absolute no no. Instead create your slice bitmap when the engine is created and reuse it.