So, I am making something that would involve calling code from an external class and getting the methods from it to run certain code during runtime. How would I go about doing this? Is there a way to do this? Thank you for help. I haven't found any solutions through google, so I decided to ask this question.
Asked
Active
Viewed 72 times
1 Answers
0
If it is a external library the copy it to external libraries folder. What you need to do is to copy the external library (JAR file) to the /libs folder of your project.
That way those libraries will compile with your project and could be use on real device when you deploy your application.
Some times you will need to add a project to your workspace ( For example the Google Map library) and then add the library reference using the properties -> Android window at the bottom.
If it s .class file then copy it directly into your android project src folder and in that you can either put it inside existing package or create new one.

Sam
- 1,237
- 1
- 16
- 29
-
I want it to be compiled during runtime though. – user3864563 Sep 01 '14 at 04:18
-
In both cases it will compile and work properly on your device. Choose whichever option you like. – Sam Sep 01 '14 at 04:32
-
Also if you want to import java files in your project on runtime then please see this post http://stackoverflow.com/questions/5493784/writing-and-implementing-new-java-class-files-during-run-time?rq=1 – Sam Sep 01 '14 at 04:34