I have now made an update that should work with all Android versions. The given download link (GoogleDrive) downloads an almost empty APK (only one button, 3.2 MB). But you can also set your own link to your app (APK).
So check that on your devices with different Android versions, especially Android 10 and 11.
installAPK_K.apk (5.5 MB)
1 Like
Here is the new update.
It should now work with all Android versions (tested on Android 9, 10, 11).
Update v3 :
de.bodymindpower.InstallAPK.aix (9.1 KB)
Blocks
The InstallAPK
extension for AI2 (→ AndroidX) is now also available and will soon be presented in the AI2 forum. I’ll share the link here later.
2 Likes
→ AI2 version of this extension (AndroidX)
:
With this extension you can download an APK to the ASD (app-specific directory) and install it. This doesn’t require WRITE / READ_EXTERNAL_STORAGE permissions. However, you can also install an APK from another directory (e.g. the /Download folder)...
Reading time: 1 mins 🕑
Likes: 6 ❤
Note : I forgot to mention that for devices with API < 19 ( KitKat
) you must ask for WRITE_EXTERNAL_STORAGE
permission:
“On Android 4.4 (API level 19) or higher, your app doesn’t need to request any storage-related permissions to access app-specific directories within external storage.”
So if your minSdkVersion < 19
use something like this:
1 Like
I made a new update (→ Version 4 ) that now has a → DownloadCompleted
event, among other things. In addition, the → /Download directory can be created in the ASD
/storage/emulated/0/Android/data/io.makeroid.companion/files/Download/
and APKs or other files can be downloaded into it. Furthermore, → subfolders can also be created in the /Download
directory of the ASD, e.g.:
/storage/emulated/0/Android/data/io.makeroid.companion/files/Download/myAppFolder/
or with subfolder :
4 Likes
themaayur
(Mayur Berad)
November 2, 2020, 11:40am
#49
Wow, nice you are continuously updating and making it better. Nice
1 Like
#iwant
There should be blocks for when download started and if an error occurred while downloading. It would be very helpful
No error should occur as long as there is a network / internet connection. You could catch this by querying the isConnected
event.
1 Like
And also what if the app is closed while downloading? does the downloading pause or continue?
please add progress event…
C.J
(Chetan Rajpurohit)
June 10, 2021, 6:00pm
#56
hey, i tried this but its not working. that file is already exist but it still downloading a new file with new name.
i dont know what is wrong
You should debug your blocks. The File
component need needs a relative path for the File.Exists
method.
See also here:
I am really not a fan of the File component for these reasons:
The really disturbing thing is the constant alternation between relative and absolute path.
Copying from the assets does not work
Permissions are also requested for the ASD (but this applies to many components, but I’m sure this will be fixed when Kodular targets Android 11, Aug 2021).
It’s really hard to get it working, because there are several issues with the File component:
Sometimes the full path and sometimes the relative is used (see blocks below)
WRITE permission is not queried automatically (only READ), so you have to ask manually for WRITE permission.
Permission granted is not triggered when the app starts for the first time, so you have to reload the screen.
Moreover: the File component can not access the assets with the APK (works only with companion).
To chec…
1 Like
Read it this way:
path (of) APK
1 Like
C.J
(Chetan Rajpurohit)
June 11, 2021, 4:24am
#61
Thank you for this amazing extension .
1 Like
C.J
(Chetan Rajpurohit)
June 11, 2021, 6:27am
#62
I did this and it worked, thank you soo much.
1 Like
C.J:
I did this and it worked
Fine, but you can avoid an additional extension (TaifunFile
):
1 Like