[android-developers] Re : Re: Application installation

2011-06-27 Thread Jérôme Beau
Hello,

By debugging against the Android code, I can find that the native activity 
manager returns -1 when asked to :

startActivity (
applicationThread, 
Intent { act=android.intent.action.PACKAGE_INSTALL 
dat=/android_asset/Android-release.apk 
typ=application/vnd.android.package-archive flg=0x1000 },

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

[android-developers] Re : Re: Application installation

2011-06-27 Thread Jérôme Beau
By debugging the Android source code, I can see that the native activity 
manager returns -1 (IActivityManager.START_INTENT_NOT_RESOLVED), when asked 
to:

startActivity(
android.app.ActivityThread$ApplicationThread@40513a00,
Intent { act=android.intent.action.PACKAGE_INSTALL 
dat=/android_asset/Android-release.apk 
typ=application/vnd.android.package-archive flg=0x1000 },
application/vnd.android.package-archive,
grantedUriPermissions = null,
grantedMode = 0,
resultWho = 0,
requestCode = -1,
onlyIfNeeded = false,
debug = false
)

Does someone know if this because nobody listens (have intent filters) 
to android.intent.action.PACKAGE_INSTALL ? Such a Intent constant seems to 
be used nowhere.

Thanks.

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

Re: [android-developers] Re : Re: Application installation

2011-06-27 Thread Dianne Hackborn
You can't do this.  You must go through the UI.

2011/6/27 Jérôme Beau javar...@gmail.com

 By debugging the Android source code, I can see that the native activity
 manager returns -1 (IActivityManager.START_INTENT_NOT_RESOLVED), when asked
 to:

 startActivity(
 android.app.ActivityThread$ApplicationThread@40513a00,

 Intent { act=android.intent.action.PACKAGE_INSTALL
 dat=/android_asset/Android-release.apk
 typ=application/vnd.android.package-archive flg=0x1000 },
 application/vnd.android.package-archive,
 grantedUriPermissions = null,
 grantedMode = 0,
 resultWho = 0,
 requestCode = -1,
 onlyIfNeeded = false,
 debug = false
 )

 Does someone know if this because nobody listens (have intent filters)
 to android.intent.action.PACKAGE_INSTALL ? Such a Intent constant seems to
 be used nowhere.

 Thanks.

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




-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Re : Re: [android-developers] Re : Re: Application installation

2011-06-01 Thread Jérôme Beau
Hi Maha,

I tried your suggestion in case of, and this produces exactly the same 
error.

Actually this doesn't surprise me, as I understand the message meaning I 
did not found any activity listening to the PACKAGE_INSTALL intent, so it 
does not even try to use the file parameter (only such an activity would use 
it, if found).
Could this be the side effect of a deprecated API (but the Intent constant 
would have been consistently deprecated), or of a security restriction, i.e. 
the activity supposed to handle this intent is not accessible and so 
interpreted as not found (but in this case the message is far from being 
clear) ?
Thank you.

P.S.: Once again, I can confirm that I have privileges granted by the 
platform key+certificate + the android.uid.system shared user id + the 
INSTALL_PACKAGES 
permission


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

[android-developers] Re : Re: Application installation

2011-06-01 Thread Jérôme Beau
May I add that I am aware of the VIEW action alternative, but that this is 
*not* what I want to do.
I want to install an application dynamically and without user interaction, 
and I have platform privileges to do so (but without being a system app 
though).

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

[android-developers] Re : Re: Application installation

2011-05-31 Thread Jérôme Beau
Hello Mah and all,

I have exactly the same problem as Surfer has, with the two conditions you 
mention met. I have sign my application with the platform (SDK for the 
moment, a real one later on) key+cert, and 
have android:sharedUserId=android.uid.system (as well as the 
granted android.permission.INSTALL_PACKAGES permission) in my manifest.
But still, after running :

  Intent myIntent = new Intent(Intent.ACTION_PACKAGE_INSTALL, 
Uri.parse(file:///android_asset/otherApp.apkfile:/android_asset/otherApp.apk
));

   myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

   startActivity(myIntent);

 
I still get an exception with No Activity found to handle Intent { 
act=android.intent.action.PACKAGE_INSTALL 
dat=file:///android_asset/otherApp.apk flg=0x1000 } 

Does this mean this no system activity (such as the PackageInstallActivity) 
is able to handle such an intent ?

Thanks for your help.

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

Re: [android-developers] Re : Re: Application installation

2011-05-31 Thread maha rm
Hi,

  Looks like the path of apk is wrong and it shoudn't be start with
file:/// protocol. Place your apk in android_asset and give the path
direclty like

   Uri.parse(/android_asset/otherApk.apk

Thanks,
Maha

2011/5/31 Jérôme Beau javar...@gmail.com

 Hello Mah and all,

 I have exactly the same problem as Surfer has, with the two conditions you
 mention met. I have sign my application with the platform (SDK for the
 moment, a real one later on) key+cert, and
 have android:sharedUserId=android.uid.system (as well as the
 granted android.permission.INSTALL_PACKAGES permission) in my manifest.
 But still, after running :

Intent myIntent = new Intent(Intent.ACTION_PACKAGE_INSTALL, Uri.parse(
 file:///android_asset/otherApp.apk));

myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

startActivity(myIntent);


 I still get an exception with No Activity found to handle Intent {
 act=android.intent.action.PACKAGE_INSTALL
 dat=file:///android_asset/otherApp.apk flg=0x1000 }

 Does this mean this no system activity (such as the PackageInstallActivity)
 is able to handle such an intent ?

 Thanks for your help.

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

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