install from app with different os compatability

78 views
Skip to first unread message

Jack Cimicato

unread,
Oct 8, 2019, 2:06:33 PM10/8/19
to MIT App Inventor Forum
I'm currently trying to have an app update its self and i need to know what activity and intent for each release of android. I need to ensure the app can update itself in all versions. knowing that the install package's name changes all the time, It would be useful if anyone can come up with a cheat sheet of them.

Thanks

-Jack

PS: knowing that api26 requires permissions to install the app. I wonder is there a way to call it without the permission and not use the app to request it. I need to have the apk opened not installed through the app.

BodyMindPower

unread,
Oct 8, 2019, 5:46:57 PM10/8/19
to MIT App Inventor Forum
Please explain more exactly what it is about. And post your relevant blocks.

TimAI2

unread,
Oct 8, 2019, 5:58:15 PM10/8/19
to MIT App Inventor Forum
Is the intent not the same for all versions?

android.intent.action.INSTALL_PACKAGE

or

android.intent.action.VIEW


Jack Cimicato

unread,
Oct 9, 2019, 1:32:54 AM10/9/19
to MIT App Inventor Forum
what im trying to do is have an app download an update and call an activity to install the apk. the app itself cannot open the file. api 25 this method works but i dont want to request another permission to make my app compatible with newer permissions. the view action cannot be used. i need to refer to the installer directly when calling the activity starter. i am wondering how to call it for different api versions since andriod documentations are confusing and tldr. the documentation has so many calls that i got lost in the paper. my dad wants to see this soon and i am really eager to get the app working. i want to impress him so can anyone clarify on what calles are in different api's

example: i got the installer activity on os6 working with:
Action = android.intent.action.MAIN
package = com.google.android.packageinstaller
class = com.android.packageinstaller.PackageInstallerActivity
datauri = file:///path/to/application.apk

i dont know of what parameters would work on other versions and its hard to find that info.

some old support post that asked this same question and it is out of date on what the calls are

the app dose not work on os9 because the activity as a whole dose not exist.
the idea to come up with a list came from that issue.

the code blocks are not going to be shown because the app is intended to be closed source and distributed privetly.

Ghica

unread,
Oct 9, 2019, 8:07:55 AM10/9/19
to MIT App Inventor Forum
Well, if it is closed source, there is not much we can do.
You have two options:
1. Make a similar example that shows the problem and that you can share with us.
2. Hope that one of us can help you privately. (Sorry, not me)
Cheers, Ghica.

Evan Patton

unread,
Oct 9, 2019, 10:25:02 AM10/9/19
to MIT App Inventor Forum
You would need to add an extension of some kind so that the INSTALL_PACKAGE or REQUEST_INSTALL_PACKAGES permission is added to your app at compile time. You need to have dangerous permissions (like installing new apps) declared in the manifest AND asked for at runtime for this to work. You can see an example in the App Inventor sources for how we do this in the companion app.

Regards,
Evan

Jack Cimicato

unread,
Oct 9, 2019, 10:38:25 AM10/9/19
to MIT App Inventor Forum
here is a striped down demo version that just includes the problem.
everything else that works is just said in text.


Jack Cimicato

unread,
Oct 9, 2019, 10:45:03 AM10/9/19
to MIT App Inventor Forum
i tried those extensions but it used file:/// but not content:/// and i cant find aynthing up to date especialy because i'm using a samsung a50 for testing and taifun hasnt updated his installer tutorial for OS 9.
i was able to at one point have some success with os8 without requesting permissions. i want to replicate this with all versions. the demo below exclaims more.

Taifun

unread,
Oct 9, 2019, 11:04:18 AM10/9/19
to MIT App Inventor Forum
see also this thread https://community.appybuilder.com/t/how-to-make-app-a-trusted-source-to-allow-app-installs-w-api26/17424
Taifun

Trying to push the limits of App Inventor! SnippetsTutorials and Extensions from Pura Vida Apps by  Taifun.

Reply all
Reply to author
Forward
0 new messages