I would like to install in Android 11 an app realized with B4A last year.
When I install the app from apk, I receive a message like this: " This app was built for an older version of Android and may not work properly. Try checking for updates, or contact the developer."
so I set in manifest targetSdkVersion="29"
AddManifestText(<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="29"/> ... )
in this way I could install the app, the message disappears but the app can't run. a white screen appears and disappears suddenly
could someone help me please?
In debug I see the wrong line is this:
File.Copy(File.DirAssets, vFileName, File.DirDefaultExternal, vFileName)
I can't copy a file and the error in log is
java.io.FileNotFoundException: /storage/emulated/0/Android/data/com.company/files/FileName.db: open failed: ENOENT (No such file or directory)
this happens only in android 11, not in Android 10...
Before we start: External storage means a real sd card or a connected mass storage USB device. This class can also be used to access the secondary storage (File.DirRootExternal). This becomes relevant with newer versions of Android that restrict direct access. It has nothing to do with runtime...
If Sys.SDK>22 Then
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For Activity_PermissionResult (Permission As String, rresult As Boolean)
If rresult Then
.............
End If
End If
this is working on android11. There are many examples on the forum