0

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?

2
  • is this what you are looking for? stackoverflow.com/questions/60764/… Commented Aug 2, 2015 at 15:24
  • @GennadiiSaprykin that link was what i was looking for!! Thank you, Commented Aug 3, 2015 at 6:00

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.