Hi,

I am trying to build an app that will load other 3rd party apk files
and can control access to them. For this reason I don't want to
install the files as then people will be able to bypass the checks my
app does etc. I was told DexClassLoader would be the best way to do
this.

Here is my code:
DexClassLoader dLoader = new DexClassLoader("/data/data/
com.craig.testapp/
test.apk","/data/data/
com.craig.testapp/",null,ClassLoader.getSystemClassLoader().getParent());
 Class calledClass = dLoader.loadClass("com.thirdparty.classname");
Intent it=new Intent(this, calledClass);
 it.setClassName("com.thirdparty", "com.thirdparty.classname");
startActivity(it);

Now I had already installed test.apk so when I ran the above code it
worked fine and launched the application. However I want to be able to
run this without test.apk being installed already (as that would
defeat the entire point of the application) . So I uninstalled it and
when I ran the my app again I get this error:

android.content.ActivityNotFoundException: Unable to find explicit
activity class {com.test/com.test.classname}; have you declared this
activity in your AndroidManifest.xml.?

So I'm not sure where to go next. I can't declare the Activity in the
Manifest becuase it is an external apk file I am trying to load. Is
this even possible? Am I going about this the wrong way? Any pointers
would be appreciated. I've done a lot of searches for more information
on DexClassLoader but I haven't been able to find anything.

Thanks,
Craig

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