Begginers questions about Files

glook

Member
Licensed User
Longtime User
I'm probably going to feel really stupid asking this, but --


Q1. How can I open a file on the SD card?

I have a file in a directory on the emulator's SD card - /sdcard/pbdb/PB.dpbm
In this case it is a database file, so try to open it :
B4X:
con.Initialize(File.DirRootExternal, "pbdb/PB.dpbm",False)
I also tried "DirDefaultExternal" and adding "/sdcard/" to the path, but it always fails to open. (I checked it is really there and correct name).

It also fails if I try to create a new test file (on sdcard).


Q2. How do I copy an existing file to the "DirInternal" ? Where does it go?

I created a new test DB file that works, but I can't see it anywhere. I thought it would be under the /data directory, but it appears empty.

Geoff.
 

Inman

Well-Known Member
Licensed User
Longtime User
Put the text file in the Files tab and then copy it to the internal storage when your program starts.

I did try something like that. But while running from emulator, I am not sure which folder on my Windows PC acts as the internal storage of the emulator.
 
Upvote 0

philgoodgood

Member
Licensed User
Longtime User
hello

have you think of creating an AVD with sdcard ?

avd.png
 
Upvote 0
Top