Android Question Android 6.0 Android Permissions

BitsAndBytes

Active Member
Licensed User
I have an app on android 6.01 and when i uninstall it , it crashes and i must go to Apps/Storage and enable the "Storage Permision". How i can show the user a message to give android permission on Storage, each time he uninstall my app ?
 

BitsAndBytes

Active Member
Licensed User
I allready set it but before i upload my app, PlayStore appeared a message which said "You are targeting users with older devices <API19 and this may be a problem" so i change it to 24API

My Code Is So Simple

B4X:
Sub Globals
    Private rp As RuntimePermissions
    Private boolNeedAccessPermision As Boolean
End Sub

Sub Activity_Create(FirstTime As Boolean)
   If FirstTime = True Then
        Activity.LoadLayout("main")
        File.Copy(File.DirAssets, "user_settings.txt", File.DirInternal, "user_settings.txt")
   End if
End sub
 
Last edited:
Upvote 0

BitsAndBytes

Active Member
Licensed User
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
module_vvvvvv1 (java line: 337)
java.io.FileNotFoundException: /storage/emulated/0/user.txt: open failed: EACCES (Permission denied)
at libcore.io.IoBridge.open(IoBridge.java:452)
at java.io.FileInputStream.<init>(FileInputStream.java:76)
at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:209)
at anywheresoftware.b4a.objects.streams.File.ReadList(File.java:233)
at agricultural.app.module._vvvvvv1(module.java:337)
at agricultural.app.main._activity_create(main.java:492)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:179)
at agricultural.app.main.afterFirstLayout(main.java:102)
at agricultural.app.main.access$000(main.java:17)
at agricultural.app.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:742)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
at libcore.io.IoBridge.open(IoBridge.java:438)
... 17 more
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
java.io.FileNotFoundException: /storage/emulated/0/user.txt:
this is another file than in your code above.... AND it is not the DirInternal....
 
Upvote 0
Top