Android Question How to Save sqlite DB from FIleDirInternal to Download dir?

cenyu

Active Member
Licensed User
Longtime User
Hello
I have small Sqlite Db into DirInternal. I have to backup this file to Download dir or some else?
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 2

cenyu

Active Member
Licensed User
Longtime User
B4X:
Private Sub ExportDb_Request
 
 
 
    Dim FileToSend As String = Main.appDataBase
    File.Copy(File.DirInternal,Main.appDataBase, Provider.SharedFolder, FileToSend)
    Dim in As Intent
    in.Initialize(in.ACTION_SEND, "")
    in.SetType("text/plain")
    in.PutExtra("android.intent.extra.STREAM", Provider.GetFileUri(FileToSend))
    in.Flags = 1 'FLAG_GRANT_READ_URI_PERMISSION
    StartActivity(in)
     
 
 
End Sub

This work for me! Thank you for helping me friends!
 
Last edited:
Upvote 0
Top