Open apk-installer with Activity Starter?

3,373 views
Skip to first unread message

Luiginator

unread,
Jul 26, 2013, 2:55:39 PM7/26/13
to ai...@googlegroups.com
Hello is it possible to open the apk installer with the activity starter?
thanks for any reply!

Peep Prants

unread,
Sep 25, 2013, 5:09:09 AM9/25/13
to ai...@googlegroups.com
Yes!
Sample!
1. Button Click
2. Set Action: android.intent.action.VIEW
4. Start Activity
5. Clock Timer: enable
This starting download apk file from internet to phone, in clock set TimeInterval to seconds that go do downloadin the file (depending apk size and internet speed)
Then:
1. Clock Timer
2. Activity Action: android.intent.action.MAIN
3. Activity Class: com.android.packageinstaller.PackageInstallerActivity
4. Activity Package: com.android.packageinstaller
5. DataUri: /mnt/sdcard/Download/Programm.apk
6. Start activity
7. Timer Disable
Ofcourse you can put apk to program, but then you apk file is bigger.
Then DataUri is something: file:///mnt/sdcard/AppInventor/assets/Programm.apk

Taifun

unread,
Sep 28, 2013, 11:31:50 AM9/28/13
to ai...@googlegroups.com
thank you for these steps! 
However, this:

Ofcourse you can put apk to program, but then you apk file is bigger.
Then DataUri is something: file:///mnt/sdcard/AppInventor/assets/Programm.apk
will not work, because that directory exists only on your development device
Someone who installs your main app will not have that directory. The only way therefore is 1. download the app (alternatively using this method http://puravidaapps.com/filebyfile.php and 2. install it then
Taifun

Peep Prants

unread,
Oct 7, 2013, 8:33:41 AM10/7/13
to ai...@googlegroups.com
Tnx, Taifun!
 Sorry, my mistake! But if file location is: file:///android_asset/Programm.apk then it must work i think?

Regards
Peep

PS! Can you please answer this also? https://groups.google.com/forum/#!topic/ai4a/_T5xcFQwwPs

Taifun

unread,
Oct 7, 2013, 8:56:00 AM10/7/13
to ai...@googlegroups.com
no, because you can't access assets of an app from outside of that app
Taifun

Taifun

unread,
Feb 3, 2014, 4:31:33 PM2/3/14
to ai...@googlegroups.com
meanwhile I prepared an example how to do it here http://puravidaapps.com/install.php
Thank you Peep!
Taifun

전제홍

unread,
May 29, 2017, 3:42:25 PM5/29/17
to App Inventor for All

Hello! Many help from your extentions and tutorials. But I had some trouble. My app provides auto update and it works on my SGS3(SHV-E210L) which android version is 4.4.4 KitKat. And now, I got a new smart phone S8+(SM-G955N)(android 7.0) and auto update doesn't work. It downloads file from internet and successed to save, but can't install with activity starter.


How can I fix this??

2014년 2월 4일 화요일 오전 6시 31분 33초 UTC+9, Taifun 님의 말:

abm.c...@gmail.com

unread,
Jun 2, 2017, 11:56:03 AM6/2/17
to App Inventor for All
Am Montag, 29. Mai 2017 21:42:25 UTC+2 schrieb 전제홍:
> Hello! Many help from your extentions and tutorials. But I had some trouble. My app provides auto update and it works on my SGS3(SHV-E210L) which android version is 4.4.4 KitKat. And now, I got a new smart phone S8+(SM-G955N)(android 7.0) and auto update doesn't work. It downloads file from internet and successed to save, but can't install with activity starter.
>
>
>
> How can I fix this??
>
> 2014년 2월 4일 화요일 오전 6시 31분 33초 UTC+9, Taifun 님의 말:
> meanwhile I prepared an example how to do it here http://puravidaapps.com/install.php
> Thank you Peep!
>
> Taifun
>  

Same for me with android 7. In the Q and A is a soloution but if i change this it also doesnt work. Any Ideas?

전제홍

unread,
Jun 2, 2017, 12:32:43 PM6/2/17
to App Inventor for All


2017년 6월 3일 토요일 오전 12시 56분 3초 UTC+9, abm.c...@gmail.com 님의 말:
Same for me with android 7. In the Q and A is a soloution but if i change this it also doesnt work. Any Ideas?

I found solution!!
Under android 5.0 supports "com.android.packageinstaler" but android 6.0+ doesn't. (I had little survey with my PackageInstallTestapk and found that android 6.0+ has same problem)
There was little change with Package name. "com.android.packageinstaller" => "com.google.android.packageinstaller"

SOLUTION: set activity starter like this on android 6.0+
Action: android.intent.action.MAIN
Activity Class: com.android.packageinstaller.PackageInstallerActivity
Activity Package: com.google.android.packageinstaller
Data Uri: file:///mnt/sdcard/*(directory and file name)


But this solution also has a problem. app which was made with appinventor can't get Android SDK version. (unless you don't use any extentions) So you have to select target android version to use (can't set on appinventor) or use extentions to get android SDK version.

John Lock

unread,
Jul 16, 2018, 8:43:50 PM7/16/18
to App Inventor for All
Hi, I'm having a different problem with installing the apk.

On the Google Pixel 8.1.0, I get the following error message:

Permission Denial: starting Intent { parameters for the activity starter show up here } from ProcessRecord{7e7f26c1202:appinventor.ai_my email address shows up here.AppUpdater/u0a186} (pid=1202, uid=10186) not exported from uid 10026

However, the exact same code works on a different android device.

The activity starter properties are exactly like in comment by Peep near the top of this thread, except the com.google.android.packageinstaller in the activity package. I get the 601 error without the .google.

I suspect it is a permissions problem, probably allow installation of non-market apps, but I don't know how to request the required permissions. I can't do it via settings.

When I call resolve activity (with the added .google), it returns the package installer.



Sorry about all of the above, just trying to provide as much relevant info as possible.

Any help is greatly appreciated.

John

전제홍

unread,
Sep 2, 2018, 1:03:10 PM9/2/18
to ai...@googlegroups.com
Install3.png
Install4.png
oh... such a google...
It might android 8.0 use different activity class.
I used "com.android.packageinstaller.InstallStart" and it succeed on S8+(SM-G955N)(android 8.0). I've tested on Note9(SM-N955N)(android 8.0) and also succeed.

Use this solution and tell me your result.
Action: android.intent.action.MAIN
Activity Class: com.android.packageinstaller.InstallStart
Activity Package: com.google.android.packageinstaller
Data Uri: file:///mnt/sdcard/*(directory and file name)

2018년 7월 17일 (화) 오전 9:43, John Lock <jo...@longheller.com>님이 작성:
--
You received this message because you are subscribed to a topic in the Google Groups "App Inventor for All" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ai4a/vfFtTq_KtCo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ai4a+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Locke

unread,
Sep 3, 2018, 8:24:14 AM9/3/18
to App Inventor for All
When I call resolve activity for the activity starter, it finds that activity, but when I try to install an app, the install prompt does not appear. Thank you for the help, but it is not working.
Message has been deleted

Abhishek Ramesh

unread,
Jun 15, 2020, 2:54:20 PM6/15/20
to App Inventor for All
Hello Taifun,


Screenshot (103).png



in the example you created, what is the content in the text box above highlighted (is that drive export download link address !? )
 or What?

Thanks for Your Help :) ,
 Abhishek

אהרון גונן

unread,
Sep 21, 2021, 3:42:20 PM9/21/21
to App Inventor for All

Hi I wanted to know if it is possible to make the installer of the package a quiet installation without asking the user whether to install the app I ask for Android 4.4
ב-יום שני, 15 ביוני 2020 בשעה 21:54:20 UTC+3, mabhishe...@gmail.com כתב/ה:
Reply all
Reply to author
Forward
0 new messages