Android Question Email database to user

kcrcawol

Member
Licensed User
Longtime User
Hi there , I have an app that only runs on 1 specific tablet. The app uses an sqlite db that is currently included in the apk and accessed via "DBFileDir = DBUtils.CopyDBFromAssets(DBFileName)" .

What I would like to do is to build the database on a desktop and email it to the user as an attachment then have the app copy the new database from the tablets download directory. Is that do-able?

Any hints greatly appreciated.
Rgds
 

mc73

Well-Known Member
Licensed User
Longtime User
Sure. Probably the file will be at file.dirrootexternal/downloads.
After all you can always let user browse for the file's location and then get your app to perform the copy.
 
Upvote 0

kcrcawol

Member
Licensed User
Longtime User
Thanks that put me on the right track

I ended up with ....
B4X:
  If FirstTime Then
    If File.Exists(File.DirRootExternal & "/download","/database.db")=False Then
        Msgbox("No file in downloads","Whoops")
    Else
      Msgbox("found one in downloads ","Yeah")
      File.Copy(File.DirRootExternal & "/download", "database.db", File.DirInternal,   "database.db")
    End If
 
    DBFileDir = File.DirInternal
  End If
 
Last edited:
Upvote 0

kcrcawol

Member
Licensed User
Longtime User
So, my problem is solved as per my previous post. How do I now close this thread? I just bet there is a big button I am staring at marked "Mark Thread as closed" but damned if I see it at the mo .
 
Upvote 0
Top