0

I am creating an android app using xamarin shared project.

I have created a database using SQLite to store user's username, password, email, and other information.

This is my code to create SQLite code but it doesn't matter bc I know it works. User can signup, login, go to home page where they can see list of user's information. This means I am able to select and insert data from UserDatabase.db3 database.

var fileName = "UserDatabase.db3";
var documentPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
var path = Path.Combine(documentPath, fileName);
var platform = new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid();
var connection = new SQLiteConnection(platform, path);

Issue is that I can't see or find UserDatabase.db3.

What I can tell is SQLite database is store on user's phone and .db3 file is hidding under location

 /Data/Data/com.companyname.AppName/File/

on google it said that some how I need to root my phone(What ever that means). But shouldn't there a way to see this find without rooting? maybe a desktop software that can access .db3 without rooting junk?

I also tried the following but db3 file was no where to find

Visual Studio > View > Tool Windows > Device File Explorer

If There is not other way to access my db3 file, than maybe there is a work around?

i guess I can just create a test page in my app where it display tables by using 'select' statment? Is this a good approch?

  • See: [How to access data/data folder in Android device?](https://stackoverflow.com/q/13006315/295004) and [How do I root my Android device?](https://android.stackexchange.com/q/1184/3573). Alternately use emulator which should allow access. – Morrison Chang Dec 12 '19 at 17:25
  • In a real phone the database is installed in a location that is not accessible, you will need to get root access. You should be able to access it only from the application(xamarin) that created the database. Or if its installed on a memory card there are other ways but not advisable. – Deleted Dec 12 '19 at 17:44
  • I tried accessing my db3 using visual studio but it didn't worked –  Dec 12 '19 at 20:15
  • @Morrison thanks but I dont feel confortable rooting my phone –  Dec 12 '19 at 20:16

1 Answers1

0

if you want to see your database,click on device file explore in Android studio->Click On Data->Click On Data->Click On "Your Package Name"->Click On Database->Here You Can See Your Database

  • under my package name, I only see two folders (Cahce, File) and both of them are empty –  Dec 12 '19 at 18:15