/storage/emulator/0

Rusty

Well-Known Member
Licensed User
Longtime User
I am running my app on an Asus 10" tablet.
I've been using the values of
B4X:
File.DirRootExternal (which, until now always return /mnt/sdcard
All of a sudden, it now returns
B4X:
/storage/emulated/0
This is not an emulator, it is a real device that used to return the former results until today.
Has anyone experienced this? If so, what caused it and how did you fix it?
Thanks,
Rusty
 
Last edited:

Rusty

Well-Known Member
Licensed User
Longtime User
Yes, it has, I believe it has been for a while, though I might be wrong on that.
Is this a new file structure under Jellybean or how does one handle this?
I'm expecting /mnt/sdcard ...
Thanks,
Rusty
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Nice of them to change it...nothing like a rogue operating system, eh?
Reminds me of the old MS/DOS frontier.

Thanks for your very fast responses :)
Rusty
 
Upvote 0

DouglasNYoung

Active Member
Licensed User
Longtime User
It shouldn't really matter what its called as long as you access it via File.DirRootExternal'!
Although its annoying - I've experienced the same issue!

Douglas
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
You are right.
I do access it via the file.dirrootexternal, but the OS seems like it is still in fairly early development. This is the third time they've changed this in the past 2 years...
Not a problem.
Regards,
Rusty
 
Upvote 0

SAM ShamsulBahrim

Member
Licensed User
Longtime User
Sorry, I do not quite get the WAY AROUND to this problem....anyone can properly say it clearly?

NOTE: I've got the same problem (as Rusty) on Asus 7" tablet.
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
When you are trying to use the device "root directory" as long as you:
B4X:
'Do this
If File.Exists(File.DirRootExternal , ...filename) then...
'Instead of this
If File.Exists("mnt/sdcard", ...filename) then...
you will be fine, it's when you hard code it like example 2 above, you get into trouble when "they" change the name/location of the data root structure.
Rusty
 
Upvote 0

SAM ShamsulBahrim

Member
Licensed User
Longtime User
Hi Rusty,

I found the way to it.... first, I copied (from inserted MicroSD card) the folder of my interest (in this case, an Images) into the built in SDCARD storage. Hence, I am having a folder called "Images" in it (the SDCARD). Then, I used the following code (in bold):

imageFolder = "/mnt/sdcard/Images/"
If File.Exists(imageFolder, "") = False Then
....

(code modified from ScrollView example)


Once running the modified ScrollView code example....bingo, the images pop up into my Asus tablet screen!

Long live B4A!!!!
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
I would do it this way so if there are OS changes, they don't affect me:
B4X:
if File.exists(file.DirRootExternal, "") = False then
This should give you the same results.
Look here for a discussion of these items.
Rusty
 
Upvote 0
Top