-1

I am working on application with multiple types choices and every type has different UI, content and operations.

If i packaged all activities, xml and drawables files inside same .apk file for all users with showing and hiding methodology it's an inefficient way as it waste user space and download time.

Are there another ways to upload activities,xml and drawables files to external servers and download them based on user selected choice?

appreciated any help. thanks.

Safa
  • 473
  • 5
  • 22

2 Answers2

1

You may download the Activities and other Java classes from the server and load them up, perhaps even Drawables, but XML part would be a tricky one.

If you can manage to avoid XMLs by creating layouts with Java if Layout is what you meant by XML, the answer is yes, it is possible.

You will need to explore how to load Java classes at runtime.

Kamran Ahmed
  • 7,661
  • 4
  • 30
  • 55
  • even layout written in .java files, also i need to upload all drawables how can link these drawables with .java files? – Safa May 08 '17 at 13:14
  • You will need a server setup that serves you images which you can process on the client side as `Bitmap`/`Drawable` and that should work just fine. You can create `Bitmap`s with byte stream and convert them to `Drawable`s if required. Refer: http://stackoverflow.com/a/7620610, http://stackoverflow.com/a/28616719 – Kamran Ahmed May 08 '17 at 13:57
  • do you think that using load java classes at runtime give users privileges to access these files and show content or remove it? – Safa May 09 '17 at 09:28
  • Yes, it will be your own implementation of downloading and loading Java classes on runtime, you can achieve what you mentioned with that. – Kamran Ahmed May 09 '17 at 14:06
0

the answer is here

Multiple APK Support -----> The build system enables you to automatically build different APKs that each contain only the code and resources needed for a specific screen density or Application Binary Interface (ABI). For more information see Build Multiple APKs.

Safa
  • 473
  • 5
  • 22