Android Question simple question about file.dirrootexternal

saeed10051

Active Member
Licensed User
Longtime User
Dear All,
l am reviewing following thread
i have an application with a csv file and some pics, currently i am placing all of these in DirAsset so that it becomes part of my apk file. But i want to keep these files in the sd card of my mobile in a specific folder and want to upload the contents while running my app. Is there a simple example of loading the data from a csv file and loading pics from sd card. There are some runtime permissions also that need to be given in this case.
 

drgottjr

Expert
Licensed User
Longtime User
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
the link provided clearly explains what is involved. (eg, you wanted to know about permissions. it is explained in the link)
if you download and run the example, you see exactly what is involved. (did you do that?)
you then take the parts you need and incorporate them into your project.

do you know how to load a file (csv, text, image) from file.dirassets? from file.dirinternal? well, this is just like that, only android doesn't allow direct access to sd cards anymore. as is explained in the link, it is very difficult now to access an sd card. you need to use the example to simplify that access. OR you need to set your target sdk to android os 4 (also explained in the link.)
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You can still use File.DirRootExternal, it is an internal sdcard though but you are able to access it using RuntimePermissions.

If it is a must for you to access an external sdcard then you need to get familar with the StorageAccessFramework. The external Storage class - as mentioned by @drgottjr - is mandatory if you want access external sdcards or usb-discs.
 
Upvote 0
Top