[android-developers] how to install an apk from the code
Hello All,
I have been trying to install an apk from the code but i haven't been
successful. could some one who has done ti tell me where is the
issue?
I was using the below snippet
Uri packageUri = Uri.fromFile(new File("data/data/MyService.apk"));
Log.e(TAG,"Path->"+packageUri.getEncodedPath());
Intent uiIntent = new Intent(this, MyService.class);
uiIntent.setAction(android.content.Intent.ACTION_VIEW);
uiIntent.setData(packageUri);
uiIntent.setType("application/vnd.android.package-archive");
startService(uiIntent);
I get the below error
Unable to start service Intent { act=android.intent.action.VIEW
typ=application/vnd.android.package-archive cmp=com.android.myactivity/
com.android.myservice.MYService }: not found
PS: I get the encoded path right, I am able to open the file and get
the size of the file too
--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home