Android Question file.db path recovery

fifiddu70

Well-Known Member
Licensed User
Longtime User
hello everyone, I should retrieve a db inside the folder of my app, the saving path is in the internal memory: file.dirInternal "comande.db"
what is the path to find this database through file manager?
 

RichardN

Well-Known Member
Licensed User
Longtime User
Unless you device is rooted you cannot access File.DirInternal. This has copy protection advantages for your data but you have found one disadvantage if you want to access the files yourself.

Try using GetSafeDirDefaultExternal
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
You can do a file.list to see all folders/files. Please use only dirinternal because Google will be much more restrictive in the future. If you need to move/copy the db, use other methods like uploading the data or sharing it (search for "share" / "intents". Why do you need to access the db's file at all?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please use only dirinternal because Google will be much more restrictive in the future
RuntimePermissions.GetSafeDirDefaultExternal will remain accessible. File.DirRootExternal won't be.

Two tips:
1. If the SQLite journal mode is set to wal then the database will be made of three files. In that case you should zip the files.
2. It is probably best to let the user share the file however they like: https://www.b4x.com/android/forum/threads/class-fileprovider-share-files.97865/#content
 
Upvote 0
Top