I tried a lot but nothing works for me ... Google Pixel 3 XL Android 11 No-Root-Access
I want to write to files, I tried every single option from File.Dir_xxxx
I want to write to my own Directory on /data/emulated/0/xxxx.
I tried here
Or here
Or here
It took me the whole evening ... who can help?
PS: Where do this lines have to be, in front of or at last of the code of a sub?
I want to write to files, I tried every single option from File.Dir_xxxx
I want to write to my own Directory on /data/emulated/0/xxxx.
I tried here
Sub Activity_PermissionResult:
Sub Activity_PermissionResult (Permission As String, Result As Boolean)
If Permission = Starter.rp.PERMISSION_ACCESS_COARSE_LOCATION Then
Result = True
Else
Log ( "PERMISSION_ACCESS_COARSE_LOCATION" )
End If
If Permission = Starter.rp.PERMISSION_ACCESS_FINE_LOCATION Then
Result = True
Else
Log ( "PERMISSION_ACCESS_FINE_LOCATION" )
End If
If Permission = Starter.rp.PERMISSION_READ_EXTERNAL_STORAGE Then
Result = True
Else
Log ( "PERMISSION_READ_EXTERNAL_STORAGE" )
End If
If Permission = Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE Then
Result = True
Else
Log ( "PERMISSION_WRITE_EXTERNAL_STORAGE" )
End If
B4XPages.Delegate.Activity_PermissionResult(Permission, Result)
End Sub
Or here
Sub Activity_Create:
Sub Activity_Create(FirstTime As Boolean)
Dim pm As B4XPagesManager
pm.Initialize(Activity)
' Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_COARSE_LOCATION)
' Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_ACCESS_FINE_LOCATION)
' Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_READ_EXTERNAL_STORAGE)
' Starter.rp.CheckAndRequest(Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
For Each permission As String In Array( Starter.rp.PERMISSION_ACCESS_COARSE_LOCATION, _
Starter.rp.PERMISSION_ACCESS_FINE_LOCATION, _
Starter.rp.PERMISSION_READ_EXTERNAL_STORAGE, _
Starter.rp.PERMISSION_WRITE_EXTERNAL_STORAGE )
Starter.rp.CheckAndRequest(permission)
Wait For Activity_PermissionResult (permission As String, Result As Boolean)
If Result = False Then
Log ("No permission!" ) ', True)
Activity.Finish
Return
End If
Next
End Sub
Or here
Manifest:
AddManifestText (
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
)
It took me the whole evening ... who can help?
PS: Where do this lines have to be, in front of or at last of the code of a sub?
Delegate:
B4XPages.Delegate