Android Question can not locate my database in my phone

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
in th attached picture number (1) is the DirInternal the b4a application return.
in th pic (2) is my real database path in the folder that called (ok)
what is the right way that let me access the database (d77.db) in the folder (ok)
i'm using the following code but idon't know how to navigate to my database in the folder (ok).
B4X:
    If FirstTime Then
        If File.Exists(File.DirInternal, "d77.db") = True Then
            SQL1.Initialize(File.DirInternal, "d77.db", False)
Msgbox("connected","")
        Else
        Msgbox("NOT connected","")
        End If
    End If
 

Attachments

  • 123.jpg
    123.jpg
    49.7 KB · Views: 154

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
i used File.DirRootExternal and it returns (/storage/emulated/0) in b4a
and i could not find that in my device

actually how access file in my device in direct path without using the (File) object in b4a
something like (file://data/data/dbase.db)
in the attached image shows my SD paths and device storage paths.
 

Attachments

  • 123.jpg
    123.jpg
    138.9 KB · Views: 159
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
n the attached image shows my SD paths and device storage paths.
The device default (left side) you can not access with your app.
DirInternal points to device (left side) \data\data\your app packagename\files

You should save the files on fileDirRootExternal (right side on your screenshot). Her your app has acces to (if you have set the correct permission)
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
but the fileDirRootExternal returns in b4a the path( /storage/emulated/0) and that path doesn't exist in the right side screenshoot as you see.
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
but Mr Erel , i need to access my database by application and physically ,i saw that in many application
is that possible in b4a?
 
Upvote 0
Top