A Ajws Member Licensed User Jan 16, 2018 #1 Hi all, help me....i'm gettting error when copying data this is error message Code: If File.Exists(File.DirInternal,"dbpo.db") = True Then Msgbox("FOUND","") File.Copy(File.DirInternal,"dbpo.db",File.DirDefaultExternal ,"dbpo.db") End If java.io.FileNotFoundException: /storage/emulated/0/Android/data/alam.com/files/dbpo.db: open failed: ENOENT (No such file or directory) File.DirDefaultExternal -> read only ???
Hi all, help me....i'm gettting error when copying data this is error message Code: If File.Exists(File.DirInternal,"dbpo.db") = True Then Msgbox("FOUND","") File.Copy(File.DirInternal,"dbpo.db",File.DirDefaultExternal ,"dbpo.db") End If java.io.FileNotFoundException: /storage/emulated/0/Android/data/alam.com/files/dbpo.db: open failed: ENOENT (No such file or directory) File.DirDefaultExternal -> read only ???
Erel B4X founder Staff member Licensed User Longtime User Jan 16, 2018 #2 1. Don't use Msgbox. Use Log instead. 2. What is the value of targetSdkVersion in the manifest editor? 3. What is the output of Log(File.DirExternalWritable)? Upvote 0
1. Don't use Msgbox. Use Log instead. 2. What is the value of targetSdkVersion in the manifest editor? 3. What is the output of Log(File.DirExternalWritable)?
A Ajws Member Licensed User Jan 16, 2018 #3 Erel said: 1. Don't use Msgbox. Use Log instead. 2. What is the value of targetSdkVersion in the manifest editor? 3. What is the output of Log(File.DirExternalWritable)? Click to expand... i use : Code: <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="23"/> Code: B4A Version: 7.30 Parsing code. (0.10s) Compiling code. Error Error compiling program. Error description: Unknown member: direxternalwritable Error occurred on line: 329 Log(File.DirExternalWritable) Word: direxternalwritable Upvote 0
Erel said: 1. Don't use Msgbox. Use Log instead. 2. What is the value of targetSdkVersion in the manifest editor? 3. What is the output of Log(File.DirExternalWritable)? Click to expand... i use : Code: <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="23"/> Code: B4A Version: 7.30 Parsing code. (0.10s) Compiling code. Error Error compiling program. Error description: Unknown member: direxternalwritable Error occurred on line: 329 Log(File.DirExternalWritable) Word: direxternalwritable
Erel B4X founder Staff member Licensed User Longtime User Jan 16, 2018 #4 It should be File.ExternalWritable Anyway, if targetSdkVersion >= 23 then you should use RuntimePermissions.GetSafeDirDefaultExternal instead of File.DirDefaultExternal: https://www.b4x.com/android/forum/threads/runtime-permissions-android-6-0-permissions.67689/#content Upvote 0
It should be File.ExternalWritable Anyway, if targetSdkVersion >= 23 then you should use RuntimePermissions.GetSafeDirDefaultExternal instead of File.DirDefaultExternal: https://www.b4x.com/android/forum/threads/runtime-permissions-android-6-0-permissions.67689/#content
A Ajws Member Licensed User Jan 17, 2018 #5 Erel said: It should be File.ExternalWritable Anyway, if targetSdkVersion >= 23 then you should use RuntimePermissions.GetSafeDirDefaultExternal instead of File.DirDefaultExternal: https://www.b4x.com/android/forum/threads/runtime-permissions-android-6-0-permissions.67689/#content Click to expand... This is my manifest... Code: '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="5" android:targetSdkVersion="23"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:anyDensity="true"/> ) SetApplicationAttribute(android:icon, "@drawable/icon") SetApplicationAttribute(android:label, "$LABEL$") AddManifestText( <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" /> ) Code: Log(File.ExternalWritable) ' ---> return true but still error java.io.FileNotFoundException: /storage/emulated/0/Android/data/alam.com/files/dbpo.db: open failed: ENOENT (No such file or directory) Upvote 0
Erel said: It should be File.ExternalWritable Anyway, if targetSdkVersion >= 23 then you should use RuntimePermissions.GetSafeDirDefaultExternal instead of File.DirDefaultExternal: https://www.b4x.com/android/forum/threads/runtime-permissions-android-6-0-permissions.67689/#content Click to expand... This is my manifest... Code: '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="5" android:targetSdkVersion="23"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:anyDensity="true"/> ) SetApplicationAttribute(android:icon, "@drawable/icon") SetApplicationAttribute(android:label, "$LABEL$") AddManifestText( <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" /> ) Code: Log(File.ExternalWritable) ' ---> return true but still error java.io.FileNotFoundException: /storage/emulated/0/Android/data/alam.com/files/dbpo.db: open failed: ENOENT (No such file or directory)
Erel B4X founder Staff member Licensed User Longtime User Jan 17, 2018 #6 Anyway, if targetSdkVersion >= 23 then you should use RuntimePermissions.GetSafeDirDefaultExternal instead of File.DirDefaultExternal: https://www.b4x.com/android/forum/threads/runtime-permissions-android-6-0-permissions.67689/#content Upvote 1
Anyway, if targetSdkVersion >= 23 then you should use RuntimePermissions.GetSafeDirDefaultExternal instead of File.DirDefaultExternal: https://www.b4x.com/android/forum/threads/runtime-permissions-android-6-0-permissions.67689/#content