Hi all
I've a problem.
My app is on Google Play Store uploaded on 03/17 2023. If I install it on my Samsung Android SDK: 33 (13) it installs and works fine.
I'm doing my debugging on my Android LG Android SDK: 29 (10).
But if I do my debugging on Samsung Android SDK: 33 (13) I have a problem with setting permissions.
When I request either of these permissions WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE it fails.
My Confirured Paths (see the screenshot)
My Manifest
If I don't request these permisions my app works fine on my Samsung. I can use a database file, write to external folder, read fromn this folder and so on.
My question is - why the app installed from the Google play store on my Samsung with WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permissions works when I requested these permissions but the same app on the same phone doesn't work in debugging?
This is my code for requset permissions
On My LG request of these permissions returns True.
I've a problem.
My app is on Google Play Store uploaded on 03/17 2023. If I install it on my Samsung Android SDK: 33 (13) it installs and works fine.
I'm doing my debugging on my Android LG Android SDK: 29 (10).
But if I do my debugging on Samsung Android SDK: 33 (13) I have a problem with setting permissions.
When I request either of these permissions WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE it fails.
My Confirured Paths (see the screenshot)
My Manifest
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="33"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:usesCleartextTraffic, "true")
SetApplicationAttribute(android:allowBackup, "false")
CreateResourceFromFile(Macro, Themes.LightTheme)
'Non-SSL permission
CreateResourceFromFile(Macro, Core.NetworkClearText)
'End of default text.
AddPermission (android.permission.WRITE_EXTERNAL_STORAGE)
AddPermission (android.permission.READ_EXTERNAL_STORAGE)
' FusedLocationProvider:
' required manifest entry required for Google Play Services
AddApplicationText(<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />)
SetActivityAttribute(MessageDetails, android:windowSoftInputMode, adjustPan|stateHidden)
'Farebase
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)
If I don't request these permisions my app works fine on my Samsung. I can use a database file, write to external folder, read fromn this folder and so on.
My question is - why the app installed from the Google play store on my Samsung with WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permissions works when I requested these permissions but the same app on the same phone doesn't work in debugging?
This is my code for requset permissions
B4X:
Private Sub SetPermission
Try
For Each Permission As String In Array(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE, Starter.rp.PERMISSION_READ_EXTERNAL_STORAGE, Starter.rp.PERMISSION_ACCESS_FINE_LOCATION, _
Starter.rp.PERMISSION_RECORD_AUDIO, _
Starter.rp.PERMISSION_CAMERA)
Starter.rp.CheckAndRequest(Permission)
Wait For Activity_PermissionResult (Permission As String, Result As Boolean)
If Result = False Then 'Result is False when I request WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permissions
ToastMessageShow("No permission! " & Permission, True)
Log("No permission! " & Permission)
MsgboxAsync("Please allow " & Permission & CRLF &"Application will be closed","HCMS")
Wait For msgbox_result(Res1 As Int)
modFun.ExitApp
Return
End If
Next
'we have permission!
'Do something
Catch
Log("SetPermission " & LastException.Message)
modFun.ShowError("Main_SetPermission " & LastException.Message)
End Try
End Sub
On My LG request of these permissions returns True.
Attachments
Last edited: