I would like to make my application to have several skins. My primary aim was not to let the user change the skin, but to let me to customize the skin per customer.
By using styles and themes I can separate the skinning information from the layout. It works like a charm, but needs to have all the skins and all their resources (including heavy weight bitmaps) included the application, which seems as waste of precious space more as more skins created.
There is a way to make an auto build (ant) script and let it decide what to include, but for some other reasons it is not preferable.
I have seen several application on the market that uses separated theme files (downloadable and installable separately) so I have the guess that moving these info into separated APK can be achieved.
I’ve got so far that letting my app and skin provider apk have the same UserID to have more free access to each other, but still doesn’t know how to get the resources.
Content provider could be a solution, but with a cost of moving layout information back to code from XMLs and having a plus layer with some performance issues not adviceable for a solemly visual effect.
What is the best practice for this issue?
One more important info: I have to use API level 7 (2.1), so solutions working only in higher level APIs are out of scope.
This will give you the resources for the specified apk. themePackage should be the full package of the theme you’re trying to access. context is the context of the caller, i.e. your application’s context.