Click here to Skip to main content
15,899,025 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to load classes from JAR file at runtime in my android application. I am using DexClassLoader for it.

I am doing it like below steps:- Some JAR file is present in some memory location on harddisk. I am preparing dex file from that JAR and storing it in application's appdex folder. Then I am using DexClassLoader to load class and then creating instance of class and calling its methods using Interface.

Problem - It is working only if I am including JAR file in libs folder of android project (on eclipse). If I am removing JAR file from libs folder, then while calling loadClass() method, it is throwing ClassNotFoundException. Ideally it should have worked without including JAR in libs folder. I want to remove that dependency (from libs folder).

Am I missing something ?

P.S. - I have created separate android project from which I am creating JAR and using it as plugin.
Posted
Comments
Shubhashish_Mandal 8-Aug-13 2:54am    
It is something like you want to drive a car without giving it any fuel. i.e. if your jar has the dependency then you might have to mention this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900