I am android devloper I like creating ui i want to showcase my ui in way that i won't have to update app every time i make new ui. I was think thinking of making one host app and every time i make new ui, i will release it as plugin apk that i will be able to see in my host apk then i can download load it and view it
i don't want to cretate saprate apk that user has to open to see that specific ui , it should show only in my app and user can install and uninstall like plugin
if anyone have any idea or example i will be very grateful if you tell me
(i will use github to distribute apk and plugin apk)
i haven't tried any thing as i don't know where to start (and i fot to mention i am working in jetpack compose )
I am android devloper I like creating ui i want to showcase my ui in way that i won't have to update app every time i make new ui. I was think thinking of making one host app and every time i make new ui, i will release it as plugin apk that i will be able to see in my host apk then i can download load it and view it
i don't want to cretate saprate apk that user has to open to see that specific ui , it should show only in my app and user can install and uninstall like plugin
if anyone have any idea or example i will be very grateful if you tell me
(i will use github to distribute apk and plugin apk)
i haven't tried any thing as i don't know where to start (and i fot to mention i am working in jetpack compose )
Share Improve this question asked Feb 15 at 4:32 Akshar KalathiyaAkshar Kalathiya 253 bronze badges2 Answers
Reset to default 0There is a feature called Activity embedding
.
To load ui from external app, use Cross-application embedding.
You can implement that mentioned plugin startegy, using ClassLoader
s (typically a DexClassLoader), but there are a lot of catches. Dynamically loading code can open security risks. You would have to make sure you trust the source of your plugins and consider sandboxing or verifying the APK’s integrity, loading and offloading the resources, handle challenging permissions needed to do so, aaand so on...
So that's a long and painful way.
BUT
Considering your needs, there are some actual ACHIEVABLE approaches.
To define the entire view set you would need and recognize your views via flags. (but still not dynamic)
Try to define them using "Resources" and "Assets" files. (Recommended) Try to make your views dynamic by extracting everything you can in Resources, then, by whatever policy you wish, you can replace (or append) the resources file by another one which you fetch from a remote server.
Using WebViews like Iframes and show different segments, and whenever you decide to change the appearance, (since it is a web content) you just change the web frontend.
Hope that meet your needs,