Download and replace Android resource files

前端 未结 2 610
失恋的感觉
失恋的感觉 2020-12-16 06:01

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 def

相关标签:
2条回答
  • 2020-12-16 06:29

    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..

    0 讨论(0)
  • 2020-12-16 06:34

    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.

    0 讨论(0)
提交回复
热议问题