Copying files

harlechguy

Member
Licensed User
Longtime User
Hi I have written a small database app in basic4android which works ok -
the sqllite database has been created in windows and I have copied it manually (using astro) to my sd card this is then accessed from my basic4android app.

i have not been able to see how to use basic4android to move the file to my SD card - e.g if I wanted to share the app with others.

a pointer for basic syntax would be much appreciated.

many thanks
 
Last edited:

harlechguy

Member
Licensed User
Longtime User
Hi, thanks for the heads up - info looks strait forward but must be missing something

am using code below but generating and error

If FirstTime Then
If File.Exists(File.DirRootExternal, "orddat.db") = False Then
File.Copy(File.DirAssets, "orddat.db", File.DirRootExternal, "orddat.db")
End If
sql1.Initialize (File.DirRootExternal, "orddat.DB",False)
End If

error is: 'java.io.IOException'

have 'ticked' 'Can install to external storage' and have tried using 'file.dirInternal'

any pointers appreciated - thanks
 
Upvote 0

harlechguy

Member
Licensed User
Longtime User
That worked a treat - thanks
What is the files size limit for '.db' files - the database in use is @ 3mb

thanks again
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
How strange of Android. And they haven't fixed it?

Crikey I can see someone clicking on their pc or mac the jpg file thinking it's a picture lol.

cheers, Ricky
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
He just suggested ".jpg", maybe using a custom format would do the trick? E.g ".tdb"?
If you use a format that is already compressed, Android will not re-compress it.
So anything like jpg, mp3 and maybe zip will work.
Anything else will be compressed into the apk, and this bug occurs in the decompression phase.
 
Upvote 0
Top