I realize this will have to involve the user and a prompt screen will show 
up; this is OK.

On Thursday, March 7, 2013 3:52:41 PM UTC-7, JavaSrvcs wrote:
>
> I am looking for two examples (have searched all over, found many examples 
> and nothing works).
>
> Inside an activity, I want to be able to install an app 
> From the Google Play Store
> From a url:  http://host/path_to/app.apk
>
> I tried this:
>
>     apkurl is defined above as private String apkurl = "
> http://host/path_to/app.apk";;
>
>     this following method called from onCreate()
>     ...
>     private void installApp() {
>         try {
>             Intent promptInstall = new Intent(Intent.ACTION_VIEW)
>                     .setData(Uri.parse(apkurl))
>                     .setType("application/vnd.android.package-archive");
>             startActivity(promptInstall);
>         } catch (Exception e) {
>             e.printStackTrace();
>         }
>
>         When the above code is run, I get this exception in the debugger
>         // android.content.ActivityNotFoundException: No Activity found to 
> handle Intent { act=android.intent.action.VIEW 
> typ=application/vnd.android.package-arc
>     }
>
> I am also looking for a way to install an app via the market URI, I have 
> tried half a dozen examples and nothing works.  If there is an Intent that 
> I can run that will install an apk from the market for from a direct url 
> link to an apk, please advise.  Spinning my wheels here to get this to work 
> and any help would be appreciated.
>
> thanks
>
> J.V.
>

-- 
-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to