2017년 7월 14일 금요일

Open apk-installer with Activity Starter?


Hello is it possible to open the apk installer with the activity starter?
thanks for any reply!

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

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

--
Sorry, my mistake! But if file location is: file:///android_asset/Programm.apk then it must work i think?

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

--
no, because you can't access assets of an app from outside of that app

--
meanwhile I prepared an example how to do it here http://puravidaapps.com/install.php

Thank you Peep!

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

--
- show quoted text -
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?

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

--

댓글 없음:

댓글 쓰기