Hello
I'm trying to use the externalStorage library, everything works fine, but the ListFiles method is VERY slow on some phones.
With 60ish files it takes like about 4 seconds on a motorola g30. It's enough time that android pops up the message "The application is not responding, wait/kill?"
Taking a look around the forums, i tried replacing externalstorage.listfiles with:
Compiles fine, but i'm getting java.lang.NullPointerException: null receiver on the second line
Anyone knows why?
Also, for the second part seems like many posts refer to using :
instead of
but can't find anything about that method...
Thanks for your time
I'm trying to use the externalStorage library, everything works fine, but the ListFiles method is VERY slow on some phones.
With 60ish files it takes like about 4 seconds on a motorola g30. It's enough time that android pops up the message "The application is not responding, wait/kill?"
Taking a look around the forums, i tried replacing externalstorage.listfiles with:
B4X:
Public Sub ListFiles2 As List
Dim folder As ExternalFile = Storage.Root
Dim files() As Object = folder.Native.RunMethod("listFiles", Null)
Dim res As List
res.Initialize
For Each f As JavaObject In files
If f.IsInitialized Then res.Add(Storage.FindFile(folder, f.RunMethod("getName", Null)))
Next
Return res
End Sub
Compiles fine, but i'm getting java.lang.NullPointerException: null receiver on the second line
Anyone knows why?
Also, for the second part seems like many posts refer to using :
B4X:
DocumentFileToExternalFile(f)
B4X:
ExtStorage.FindFile(folder, f.RunMethod("getName", Null))
but can't find anything about that method...
Thanks for your time