Hi i am new to android development and i want to build app with this capability. When it starts, it loads class file from somewhere in the storage and instatiate it and call its member function. Like, after app is started and there are bunch of buttons on window with classes name to be loaded from storage. When i press button with certain class' name, it loads that class from storage and i can use that function. All classes have interface so i will manipulate class with only interfaces. Can i do these in android?
Asked
Active
Viewed 78 times
1 Answers
1
You can do this with Reflection API in Java. You can load class by providing its name as string values to Class.forName("classnameToBeLoaded")
method, but you need to take care regarding the class availability while loading the class dynamically.

Mohit Kanwar
- 2,962
- 7
- 39
- 59

Ganesh
- 26
- 1
-
Then here's another question. If app is uploaded on the smartphone as apk and put jar in another place. Can apk file reference jar in another place given that apk knows where jar is and what jar name is and what classes jar has? – 강신욱 Aug 03 '15 at 07:16