Android Question How to find the file stored in the phone?

yshzsl

Member
Hello everyone.
I have a Table form,I want to export the data in the table to a file in the CSV format, the code is as follows:
B4X:
Table1.SaveTableToCSV(File.DirInternal,"aaa.csv")
After successful execution,No aaa.CSV file to search in the phone.
Which folder is the File.DirInternal in the internal storage of the phone?I couldn't find it.
I have used the following code to copy the database to the phone,The program can run properly,But the database file cannot be found using File Manager.
B4X:
SQLDateBaseName=”lb.db”
If File.Exists(File.DirInternal,SQLDateBaseName)=False Then
    File.Copy(File.DirAssets,SQLDateBaseName,File.DirInternal,SQLDateBaseName)
End If
I want to copy the database files or other files exported to the phone from the phone to the computer or other storage device, but I don't know how to do it, please help me.
 
Solution
Add the RuntimePermissions library to your project.
Instead of
B4X:
File.DirInternal
use
B4X:
Private rp As RuntimePermissions    'Put this in Process Globals


rp.GetSafeDirDefaultExternal("")
Connecting your phone to PC you will find your files in
Android/data/PACKAGENAME/Files

Sagenut

Expert
Licensed User
Longtime User
Add the RuntimePermissions library to your project.
Instead of
B4X:
File.DirInternal
use
B4X:
Private rp As RuntimePermissions    'Put this in Process Globals


rp.GetSafeDirDefaultExternal("")
Connecting your phone to PC you will find your files in
Android/data/PACKAGENAME/Files
 
Upvote 0
Solution

yshzsl

Member
Thanks for the guidance,Sagenut.In your way I got the folder structure of stored internally,Implemented the Folder options dialog box with Erel's Save As code,I can now select the file storage location.
Thank you again.
 
Upvote 0
Top