tigrot Well-Known Member Licensed User Longtime User Sep 11, 2016 #1 Hi everybody, I'm struggling with creating a directory on SD. Code: Dim lista As List=File.ListFiles("/storage/sdcard1") For Each e In lista Log(e) Next File.makedir("/storage/sdcard1/Android","") lista shows correctly the content of SD card on a Android 5. I try to create the structure: "Android/data/it.logicdata.cncfiler/files" but I didn't succede(no error, simply directory is not created) Also creating "Android" only obtains same results. On 4.2 is OK. Here is the relevant code for manifest Code: AddManifestText( <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> ) Does somebody knows why? Thank you! Mauro
Hi everybody, I'm struggling with creating a directory on SD. Code: Dim lista As List=File.ListFiles("/storage/sdcard1") For Each e In lista Log(e) Next File.makedir("/storage/sdcard1/Android","") lista shows correctly the content of SD card on a Android 5. I try to create the structure: "Android/data/it.logicdata.cncfiler/files" but I didn't succede(no error, simply directory is not created) Also creating "Android" only obtains same results. On 4.2 is OK. Here is the relevant code for manifest Code: AddManifestText( <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> ) Does somebody knows why? Thank you! Mauro
Erel B4X founder Staff member Licensed User Longtime User Sep 11, 2016 #2 tigrot said: Does somebody knows why? Click to expand... Yes. On Android 4.4+ there is a single folder in the sd card that is accessible to your app. You can use RuntimePermissions.GetAllSafeDirsExternal to find it. Upvote 0
tigrot said: Does somebody knows why? Click to expand... Yes. On Android 4.4+ there is a single folder in the sd card that is accessible to your app. You can use RuntimePermissions.GetAllSafeDirsExternal to find it.
tigrot Well-Known Member Licensed User Longtime User Sep 11, 2016 #3 I can get it also if it was not created? I have just tested that in case I create the "supposed allowed" folder every successive creation inside of it run fine. I have also created files for sql lite and a folder in it. Thank you... Mauro Upvote 0
I can get it also if it was not created? I have just tested that in case I create the "supposed allowed" folder every successive creation inside of it run fine. I have also created files for sql lite and a folder in it. Thank you... Mauro
Erel B4X founder Staff member Licensed User Longtime User Sep 11, 2016 #4 tigrot said: I can get it also if it was not created? Click to expand... Yes. It will be created automatically. Upvote 0
tigrot said: I can get it also if it was not created? Click to expand... Yes. It will be created automatically.
tigrot Well-Known Member Licensed User Longtime User Sep 11, 2016 #5 Strange things happen here. The RuntimePermissions.GetAllSafeDirsExternal returns only one element(the SD emulated in internal memory) not the SD. Code: Dim aa As RuntimePermissions Dim paths() As String=aa.GetallSafeDirsExternal("") /storage/emulated/0 Dunno if the issue is in my LG X150, but using my app I'm not able to create the structure to write permanent data on SD Ciao Mauro Upvote 0
Strange things happen here. The RuntimePermissions.GetAllSafeDirsExternal returns only one element(the SD emulated in internal memory) not the SD. Code: Dim aa As RuntimePermissions Dim paths() As String=aa.GetallSafeDirsExternal("") /storage/emulated/0 Dunno if the issue is in my LG X150, but using my app I'm not able to create the structure to write permanent data on SD Ciao Mauro
Erel B4X founder Staff member Licensed User Longtime User Sep 12, 2016 #6 Might be the same issue discussed here: http://stackoverflow.com/questions/33350250/why-getexternalfilesdirs-doesnt-work-on-some-devices Upvote 0
Might be the same issue discussed here: http://stackoverflow.com/questions/33350250/why-getexternalfilesdirs-doesnt-work-on-some-devices
tigrot Well-Known Member Licensed User Longtime User Sep 12, 2016 #7 Yes, Erel seems to be my case. At least I have found this problem before release. The problem is: How can I create the structure Android/data/"app id". I'm not able to create also a single level of folders. I'm testing other ways... Thank you again! Mauro Upvote 0
Yes, Erel seems to be my case. At least I have found this problem before release. The problem is: How can I create the structure Android/data/"app id". I'm not able to create also a single level of folders. I'm testing other ways... Thank you again! Mauro
tigrot Well-Known Member Licensed User Longtime User Sep 12, 2016 #8 Hi Erel, seems to be impossible to create (mkdir) the structure "/storage/sdcard1/Android/data/it.logicdata.cncfiler/files" after creation I'm able to create anything inside of it, both dirs and files. Definitly a bug or something that seems to be. I have tested QuickEdit which asks the permission to write to sd and then it can create a file on root. My app has full permissions for external storage. Upvote 0
Hi Erel, seems to be impossible to create (mkdir) the structure "/storage/sdcard1/Android/data/it.logicdata.cncfiler/files" after creation I'm able to create anything inside of it, both dirs and files. Definitly a bug or something that seems to be. I have tested QuickEdit which asks the permission to write to sd and then it can create a file on root. My app has full permissions for external storage.
tigrot Well-Known Member Licensed User Longtime User Sep 12, 2016 #9 I have tested that if I create "/storage/sdcard1/Android/data/it.logicdata.cncfiler" then I can do anything I need in that folder. The issue is "How create the app's private folder? Upvote 0
I have tested that if I create "/storage/sdcard1/Android/data/it.logicdata.cncfiler" then I can do anything I need in that folder. The issue is "How create the app's private folder?
tigrot Well-Known Member Licensed User Longtime User Sep 12, 2016 #10 I have done a shell mkdir and got this error mkdir failed for /storage/sdcard1/Android/data/it.logicdata.cncfiler, No such file or directory Upvote 0
I have done a shell mkdir and got this error mkdir failed for /storage/sdcard1/Android/data/it.logicdata.cncfiler, No such file or directory
Erel B4X founder Staff member Licensed User Longtime User Sep 12, 2016 #11 I don't understand. Can you create that folder or not? Upvote 0
tigrot Well-Known Member Licensed User Longtime User Sep 12, 2016 #12 Solved, or at least "almost" solved. I tell the user to create the folders in case I'm not able to do ! Dirty but effective! Upvote 0
Solved, or at least "almost" solved. I tell the user to create the folders in case I'm not able to do ! Dirty but effective!
tigrot Well-Known Member Licensed User Longtime User Sep 12, 2016 #13 No I'm not able to create programmatically : I ask the customer to do manually! Upvote 0