Android Question How to Create a folderstructure in File.Dirxxxxxx?

DonManfred

Expert
Licensed User
Longtime User
How to Create a folderstructure in File.Dirxxxxxx?
I have a app that needs some things do be downloaded. JSON-Data, Images

How can i create a folderstructure in a place which i can reach when device is connected with usb from pc?
Which one is the best Place for it?

B4X:
File.DirDefaultExternal
File.DirInternal
File.DirInternalCache
File.DirRootExternal

As of the resctrictions in KitKat (no access to external sdcards) i would prefer File.DirRootExternal. I know i can view this folder on my pc.

Can someone show me a small example how to Create a folderstructure like

/MyFolderName/Images/
/MyFolderName/json/

?

And then i need to know how i can reference to this folders when i use for example

B4X:
LoadBitmapSample(File.DirRootExternal,"icon.png",110dip,130dip)

Like this?
B4X:
LoadBitmapSample(File.DirRootExternal&"/MyFolderName/Images/","icon.png",110dip,130dip)

Many thanx for any hint or code example. Have a nice Weekend :)
 

DonManfred

Expert
Licensed User
Longtime User
ahhh... Ok. And when i create a folderstruct with
B4X:
file.MakeDir(file.DirDefaultExternal,"/Data/Images/")

How do i use this folders then? I mean reading a file from this folder

B4X:
LoadBitmapSample(File.DirDefaultExternal&"/Data/Images/","icon.png",110dip,130dip)

?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
A last question ;)

When i have created a folderstructure with
B4X:
file.MakeDir(file.DirDefaultExternal,"/Data/Images/")
and i will call that command again; will that raise an error when the folder already exists?

Yes, i know, i should test it :D But maybe you know that already and want to share your glorious knowledge? :rolleyes:
 
Upvote 0
Top