Ok. Thanks, this is clear. But "access the folder once" with what? What means "access"? Perhaps there is some misunderstanding and I don't figure out what I have to do. In this specific case, I accessed the folder with your ExternalStorage example. I saw the files. Just seen, not did anything else. I loaded them by cable, according to my habit. Nevertheless the AGraham's App still behaves same way, that is no access to the ExternalStorage. Shall I use the Samsung File Manager or what else? Thanks again.The standard way to achieve it is with ExternalStorage, which requires the user to select the folder once.
Not sure. I'm not familiar with this.Nevertheless the AGraham's App still behaves same way, that is no access to the ExternalStorage.
Not if you want to directly access all files.Shall I use the Samsung File Manager or what else?
I just need to read the files on the Sd. My files as bitmaps. Actually I read them with bm.Initialize(dir, filename). To get the "dir" I first allow the user to select one directory from the list of directories which are inside "Android/Data/MyApp.xxx/files". Let's say that dir is "/storage/emulated/0/Android/data/MyApp.xxx/files/DirName", that is "GetSafeDirDefaultExternal/etc.". I would like to have "bm.Initialize(Folder_On_SdCard,filename).Sorry, but from the post above I have no idea what your problem is with using ExternalStorage. What is it that you want to do but can't?
Maybe the confusion is due to the words used. Actually I use DefaultExternal. I was meaning, instead, the additional Sd card that I have put in the tablet.Sorry, but from the post above I have no idea what your problem is with using ExternalStorage. What is it that you want to do but can't?
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private ExtStorage As ExternalStorage
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
End Sub
Private Sub Button1_Click
Dim s As String
ExtStorage.Initialize (Me, "ExtStorage")
s=ExtStorage.SelectDir(False)
Log(s)
End Sub
Sorry, great Agraham. I just get problems ... as you see from my picture, I mostly lost my hair .. do you really think that I am just paranoic or "maybe" there is something strange? I prefer not to do any polemic on "access" or "select".. etc. this I learnt losing hair .. Of course,l i could be totally idiot .,, as usually I think of myself .. no surprise .. Thanks a lot for your patience..I know you meant the SD Card. That's why you need to use the ExternalStorage library. You seem to think that won't work for you but I fail to understand why you think that, particularly as all you want to do is to read the file. You should be able to use Bitmap.Initialize2 to read a bitmap from a file opened on an SD Card input stream.
Well. The progress I did is that, putting a stupid Sleep(1000) after initialization, I have no crash with SelectDir(False) (with true it happens anyway). Anyway, the Log of the s=SelectDir(false) shows an empty string. etc. etc.. Thanks.Your problem is
java.lang.ClassNotFoundException: androidx$documentfile$provider$DocumentFile
For some reason the ExternalStorage library can't find the Java DocumentFile class. I'm afraid that I haven't used ExternalStorage myself for years as all my current devices don't have SD Card slots so I can't suggest why this class is missing. Maybe someone else can suggest something.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?