On Mar 18, 7:29 am, Asif k <asifk1...@gmail.com> wrote:
>   I am storing the required test.jar file in the /sdcard. I want to
> load it dynamically at runtime and want to execute a function xyz()
> resides in that. For this purpose
>
>   I had written following code ,

This doesn't work -- in 1.0 you can't load jar/apk files that aren't
part of your application.  The problem is that it wants to pull
classes.dex out of the jar/apk and put it in /data/dalvik-cache, but
it doesn't have permission to do so.

The "cupcake" release is expected to include the DexClassLoader class,
which allows you to specify a location other than /data/dalvik-cache
for your output files.


> But got ClassCastException : dalvik.system.PathClassLoader

URLClassLoader systemLoader = (URLClassLoader) ClassLoader
            .getSystemClassLoader();

Assuming that the system class loader is a URLClassLoader is unwise
and unnecessary.  Just use ClassLoader.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to