sirjo66 Well-Known Member Licensed User Longtime User Sep 5, 2018 #1 Not a very problem, but...... When I run in "debug" mode I write my files in File.DirDefaultExternal so I can watch it and I can control if it works fine, but when I run in "release" mode I write my files in File.DirInternal so I don't need WRITE_EXTERNAL_STORAGE permissions and all works very well. So I use this code in Main activity: Code: Copy Sub Process_Globals #if DEBUG Public MyDir As String = File.DirDefaultExternal #else Public MyDir As String = File.DirInternal #End If End Sub But when I select "Debug" mode, and click "List Permissions" on "Logs" tab, don't appeare android.permission.WRITE_EXTERNAL_STORAGE If I change to Code: Copy Sub Process_Globals Public MyDir As String = File.DirDefaultExternal End Sub on "List Permissions" it appeare correctly Sergio
Not a very problem, but...... When I run in "debug" mode I write my files in File.DirDefaultExternal so I can watch it and I can control if it works fine, but when I run in "release" mode I write my files in File.DirInternal so I don't need WRITE_EXTERNAL_STORAGE permissions and all works very well. So I use this code in Main activity: Code: Copy Sub Process_Globals #if DEBUG Public MyDir As String = File.DirDefaultExternal #else Public MyDir As String = File.DirInternal #End If End Sub But when I select "Debug" mode, and click "List Permissions" on "Logs" tab, don't appeare android.permission.WRITE_EXTERNAL_STORAGE If I change to Code: Copy Sub Process_Globals Public MyDir As String = File.DirDefaultExternal End Sub on "List Permissions" it appeare correctly Sergio
Erel B4X founder Staff member Licensed User Longtime User Sep 5, 2018 #2 Don't use DirDefaultExternal. Use RuntimePermissions.GetSafeDirDefaultExternal. It doesn't require any permission on Android 4.4+ devices. Upvote 0
Don't use DirDefaultExternal. Use RuntimePermissions.GetSafeDirDefaultExternal. It doesn't require any permission on Android 4.4+ devices.
Eugene Puah New Member Licensed User Nov 26, 2018 #3 Erel said: Don't use DirDefaultExternal. Use RuntimePermissions.GetSafeDirDefaultExternal. It doesn't require any permission on Android 4.4+ devices. Click to expand... Can I replace this code instead of file. DirInternal for the WRITE EXTERNAL STORAGE Upvote 0
Erel said: Don't use DirDefaultExternal. Use RuntimePermissions.GetSafeDirDefaultExternal. It doesn't require any permission on Android 4.4+ devices. Click to expand... Can I replace this code instead of file. DirInternal for the WRITE EXTERNAL STORAGE
Erel B4X founder Staff member Licensed User Longtime User Nov 26, 2018 #4 Please start a new thread and better explain what you are trying to solve. Upvote 0