B barryhuntpinncomp Member Licensed User Longtime User May 9, 2018 #1 Until recently my program has been able to write and read a particular file. For no apparent reason the file cannot be read at present. I get java.io.FileNotFoundException: /storage/emulated/0/BarryWalk/rates.txt (Permission denied) File.exists returns true. The file can be read by a different program on the same device. The two program's manifest are identical. They both contain AddPermission(android.permission.WRITE_MEDIA_STORAGE) AddPermission(android.permission.WRITE_EXTERNAL_STORAGE) I cannot think of any other settings. Any help would be much appreciated.
Until recently my program has been able to write and read a particular file. For no apparent reason the file cannot be read at present. I get java.io.FileNotFoundException: /storage/emulated/0/BarryWalk/rates.txt (Permission denied) File.exists returns true. The file can be read by a different program on the same device. The two program's manifest are identical. They both contain AddPermission(android.permission.WRITE_MEDIA_STORAGE) AddPermission(android.permission.WRITE_EXTERNAL_STORAGE) I cannot think of any other settings. Any help would be much appreciated.
R ronell Well-Known Member Licensed User Longtime User May 9, 2018 #2 does the 2 device had the same os/android version? Upvote 0
B barryhuntpinncomp Member Licensed User Longtime User May 9, 2018 #3 There is only one device running two programs. Both programs have the identical read statement. l= File.ReadString(File.DirRootExternal, "/BarryWalk/rates.txt") One works and the other does not Upvote 0
There is only one device running two programs. Both programs have the identical read statement. l= File.ReadString(File.DirRootExternal, "/BarryWalk/rates.txt") One works and the other does not
DonManfred Expert Licensed User Longtime User May 9, 2018 #4 https://www.b4x.com/android/forum/threads/android-jar-targetsdkversion-minsdkversion.87610/ Add Runtimepermissions to your project. Upvote 0
https://www.b4x.com/android/forum/threads/android-jar-targetsdkversion-minsdkversion.87610/ Add Runtimepermissions to your project.
B barryhuntpinncomp Member Licensed User Longtime User May 9, 2018 #5 Thank you for the link. When I add the module Runtimepermissions (without any extra coding) I get a compile error. Maven artifact not found: android.arch.lifecycle/livedata-core Upvote 0
Thank you for the link. When I add the module Runtimepermissions (without any extra coding) I get a compile error. Maven artifact not found: android.arch.lifecycle/livedata-core
R ronell Well-Known Member Licensed User Longtime User May 9, 2018 #6 barryhuntpinncomp said: There is only one device running two programs. Both programs have the identical read statement. l= File.ReadString(File.DirRootExternal, "/BarryWalk/rates.txt") One works and the other does not Click to expand... sorry, misread Upvote 0
barryhuntpinncomp said: There is only one device running two programs. Both programs have the identical read statement. l= File.ReadString(File.DirRootExternal, "/BarryWalk/rates.txt") One works and the other does not Click to expand... sorry, misread
R ronell Well-Known Member Licensed User Longtime User May 9, 2018 #7 barryhuntpinncomp said: Thank you for the link. When I add the module Runtimepermissions (without any extra coding) I get a compile error. Maven artifact not found: android.arch.lifecycle/livedata-core Click to expand... you are missing a component in your sdk manager see this https://www.b4x.com/android/forum/t...d-android-arch-lifecycle-livedata-core.90086/ Upvote 0
barryhuntpinncomp said: Thank you for the link. When I add the module Runtimepermissions (without any extra coding) I get a compile error. Maven artifact not found: android.arch.lifecycle/livedata-core Click to expand... you are missing a component in your sdk manager see this https://www.b4x.com/android/forum/t...d-android-arch-lifecycle-livedata-core.90086/
B barryhuntpinncomp Member Licensed User Longtime User May 9, 2018 #8 OK, great thank you. I have now added the "RunPermission" library but I am struggling as to how it should be used. I tried rp.CheckAndRequest("PERMISSION_READ_EXTERNAL_STORAGE") Log(rp.Check ("PERMISSION_READ_EXTERNAL_STORAGE")) - it returned false but I admit to being out of my depth. Upvote 0
OK, great thank you. I have now added the "RunPermission" library but I am struggling as to how it should be used. I tried rp.CheckAndRequest("PERMISSION_READ_EXTERNAL_STORAGE") Log(rp.Check ("PERMISSION_READ_EXTERNAL_STORAGE")) - it returned false but I admit to being out of my depth.
DonManfred Expert Licensed User Longtime User May 9, 2018 #9 See Runtimepermission Tutorial..... Upvote 0
B barryhuntpinncomp Member Licensed User Longtime User May 9, 2018 #10 OK, thank you for your help and patience. It is very much appreciated. Upvote 0