Data files on SD Card workaround?

SarahWard

Banned
Has anyone got ideas on a workaround for using a large amount of data (jpgs, mp3s, txts) stored on the SD Card with Android?

As I understand it, Android apps have to include all data in the actual app itself. This limits the amount of data you can use quite considerably as the app would presumably be loaded into internal memory.

Is there any way to access data files stored on the storage card? Any ideas, guys?

Sarah
 

agraham

Expert
Licensed User
Longtime User
As I understand it, Android apps have to include all data in the actual app itself.
Not so.

Is there any way to access data files stored on the storage card?

B4X:
MyDir = File.DirRootExternal & "/Something"
MyFile = "SomethingElse"
Dim istream As InputStream
istream = File.OpenInput(MyDir, MyFile)

or if your data is in a SLite database

Dim SQL1 As SQL
SQL1.Initialize(MyDir, MyFile, False)
You will have to get the data onto the correct folder on the SD card by copying it over USB or possibly downloading it from your website.
 

glook

Member
Licensed User
Longtime User
Agraham is right of course. I am also accessing a large database, up to 300Mb, in a folder on the SD card (tested on emulator only).

Distribution is a long, long way off yet, but at the moment I'm thinking of a zip file with the apk and data files. plus instructions on where to put them via usb. I would be interested in any better ideas or 'best practices' for distributing apps with large data files.

Geoff.
 
Top