@Erel’s example in post #1 of this thread: https://www.b4x.com/android/forum/threads/version-safe-apk-installation.87667/ works well if I am using the storage of the apk file to install as; File.DirDefaultExternal when the phone API is 24, OS 7. But I really, I mean REALLY want the apk to be on File.DirRootExternal, but of course because of permission, the app cannot be installed with an error of:
File.copy(File.DirAssets, ApkName, Starter.Shared
java.io.FileNotFoundException: /storage/emulated/0/2nd_app.apk (Permission denied)
Is there any way to overcome this limitation and have the apk of the app to be installed reside on DirRootExternal. I prefer to always use RootExternal (easier to manage). I do not like to deal with DefaultExternal folders.
The below code only yields: /storage/emulated/0/Android/data/b4a.example3/files :
File.copy(File.DirAssets, ApkName, Starter.Shared
java.io.FileNotFoundException: /storage/emulated/0/2nd_app.apk (Permission denied)
Is there any way to overcome this limitation and have the apk of the app to be installed reside on DirRootExternal. I prefer to always use RootExternal (easier to manage). I do not like to deal with DefaultExternal folders.
The below code only yields: /storage/emulated/0/Android/data/b4a.example3/files :
B4X:
For Each f As String In Starter.rp.GetAllSafeDirsExternal("")
Log(f)
Next