Hi again,

I've hit a bit of a wall. Any help would be appreciaited. I have
gotten the DecClassLoader to work(kind of)

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

Now I had already isntalled test.apk so wen 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 a bit stumped here. This activity is declared in the Manifest
of the apk I am trying to run. I can't declare it in my applications
Manifest. Any ideas?

Thanks,
Craig

On May 13, 10:31 am, Craig O Connor <[email protected]> wrote:
> Hi guys,
>
> I'm having a bit of trouble getting this to work.
>
> If I want to put an apk file in my app what folder should I put it in.
> And how do I access it?
>
> I've tried putting it in the res/raw folder and the assets folder but
> I can't seem to get it to work.
>
> Thanks in advance.
>
> Best Regards,
> Craig
>
> On Mar 22, 7:00 pm, Craig O Connor <[email protected]> wrote:
>
>
>
> > Sorry for the delay. Only just now realised my question had been
> > approved. Thanks for pointing me in the right direction. I will try
> > this now.
>
> > Thanks,
> > Craig
>
> > On Mar 15, 8:02 pm, fadden <[email protected]> wrote:
>
> > > On Mar 12, 8:38 pm, Lance Nanek <[email protected]> wrote:
>
> > > > I saw a thread with people loading APKs via DexClassLoader 
> > > > here:http://stackoverflow.com/questions/1001944/android-remote-code-loading
>
> > > Yes, use DexClassLoader.  Tthe app needs a place to unpack and fix up
> > > the DEX data (the alternative being to hold the entire thing in
> > > unshared memory).  Unless you have a rooted phone, you can't store it
> > > in /data/dalvik-cache like the system does.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

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

Reply via email to