My application will have some customisation for each company that uses it. Up until now, I have been loading images and strings from resource files. The idea is that the default resources will be distributed with the application and company specific resources will be loaded from our server after they click on a link from an email to launch the initialisation intent. Does anyone know how to replace resource files? I would really like to keep using resource files to avoid rewriting a lot of code/XML.
I would distribute the application from our own server, rather than through the app store, so that we could have one version per company, but unfortunately this will give quite nasty security warnings that would concern our customers.
Does anyone know how to replace resource files?
It is not possible, except by deploying an updated APK. APKs are digitally signed and cannot be modified at runtime.
No it is not possible, but here is what you can do instead... Copy your images etc in the Assets folder.. From the assets folder , copy them at runtime in the Application dir.. ie data/data/yourapppackage/yourresourcefolder
Use the images etc from the runtime folder.. Ie In code say,.. imageView.setBackgroundDrawable(data/data/apppackagename/download/themename/resourcename)
...
Now when you download your resources from a runtime path , keep an XML file with key names and path for the image as key value pairs.. Have approprite Enums for that in code and store the image paths in HashMap at runtime..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With