I have a very simple question but so far I am unable to find an answer of this question. "Is there any way of finding the absolute path of EXTERNAL (Removable Storage Card in Samsung Galaxy Tab 7.7)STORAGE DIRECTORY(SDCARD) in Android?"
Please don't recommend using File.DirRootExternal since it usually returns the path for internal storage (/mnt/sdcard).But My External sdcard that comes under /mnt/sdcard.Pls see the below
There has got to be a way for my application to send and receive files directly form an external removable SD Flash card on the Galaxy Tab
I have found hundreds of post on this issue.
Please, link all of them together with a concise answer!
Stop the madness!
As I wrote above there is no API in Android to get the path of the SD card. In fact starting from Android 4.4 you can only read and write from a very specific folder in the sd card.
As I wrote above there is no API in Android to get the path of the SD card. In fact starting from Android 4.4 you can only read and write from a very specific folder in the sd card.
I have the same problem with SDCard Document folder not recognised using:
i.Initialize2("file://" & File.DirDefaultExternal & "/storage/sdcard1/PDF/Issue 1.pdf", 0)
I found the path above using the downloaded Root Browser from this site. Please, which 'very specific' folders on a sdcard mentioned above can be written to? 77 year old would-be B4A programmer. I have a Sony Experia Z Tablet with a 64gb sdcard.
File.DirDefaultExternal and File.DirRootExternal does not point to the sd card. They point to the secondary internal storage. You can write on any folder there.
This seems to work. It works on my Galaxy S3 and a couple of virtual devices I tried it on. It will list all devices, including USB ones, so you need to figure out how to filter it to just the SD card.
B4X:
Dim de As String = File.DirRootExternal
Log ("DirRootExternal = "&de)
Dim mtc As Matcher = Regex.Matcher("(/|\\)[^(/|\\)]*(/|\\)",de)
If mtc.Find = True Then
Dim mnt As String = mtc.Group(0)
Log ("mount point = "& mnt)
Dim dirs As List = File.ListFiles(mnt)
For Each f As String In dirs
Log ("Device = "& f)
Next
End If
Works for me too
I´ve added code to get the path to MY external sdcard.
This code works on my device (Galaxy Note 3. Android 4.4.2)
B4X:
Dim de As String = File.DirRootExternal
Log ("DirRootExternal = "&de)
Dim mtc As Matcher = Regex.Matcher("(/|\\)[^(/|\\)]*(/|\\)",de)
Dim extsdcard As String = de
If mtc.Find = True Then
Dim mnt As String = mtc.Group(0)
Log ("mount point = "& mnt)
Dim dirs As List = File.ListFiles(mnt)
For Each f As String In dirs
Log ("Device = "& f)
If f.ToLowerCase.Contains("extsdcard") Then
extsdcard = mnt&f
End If
Next
End If
Log("extsdcard="&extsdcard)
For Each f As String In File.ListFiles(extsdcard)
Log(">"&f)
Next