I have an apk installed in /data/app. I want to use the class methods
in there. Here is what I tried:

        public void test0method(){
                DexClassLoader dLoader = new DexClassLoader("/data/app/
com.my.internal.apk",
                                "/data/local/tmp", null, 
ClassLoader.getSystemClassLoader());
        try {
            Class cLoad = dLoader.loadClass
("com.my.internal.SystemProperties");
// got ClassNotFoundException at above line
            Method mLoad = cLoad.getMethod("GetString",new Class[]{});
            Object obj = cLoad.newInstance();
            Object sysProp = cLoad.newInstance();
           mLoad.invoke(obj);
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
    }

I got "ClassNotFoundException". By peeking into the apk, I don't see
class files but classes.dex. I would assume SystemProperties class is
in classes.dex. Why can I load it?

What did I do wrong?

Thanks,

Sherry
--~--~---------~--~----~------------~-------~--~----~
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