Hello everybody!
I’m currently working on a small demo project with MobileDesigner and i’m trying to add various graphics for Android (hdpi/xhdpi) and iPhone [4,5].
I found some examples for ResHandlers in the given sample projects and a small documentation for the AntTaskResourceHandler, but i’m stuck in finding the best way to add Images and load them during runtime.
All examples seem to use the addUnpackedFileToJar(file)-> Image.createImage(file) approach, but this leads to a messed up resource hierarchy (all images reside under assets/ in Android(?)) and to leaky behaviour due to missing default-caching.
I found some addImage() methods in the ResourceHandler and the ImageBase/ImageHandler classes which seems to use some kind of ResourceID system, but i couldn’t find any documentation on this.
So here are my questions:
Is there any documentation/example on how to use the ImageBase’ getImage(int id) method?
If i add a Image with rh.addImage(String id, String path), do i still have to add the file with rh.addUnpackedFileToJar(String path, String path) to the resource output?
What are these strange palette-ids which are generated when using rh.addImage(String id, String path)? Do i have to take care of these anyhow?
Is there any convenient way of using the Android resource system (especially for the different resolutions). My current solutions consists of copying the different files into different folders and guessing the device resolution / loading the appropriate image during runtime.
Greetings,
Mario Heidenreich