A local database is created in the code. Where will it be located?
class DatabaseHelper {
final databaseName = "app.db";
String users =
"create table users (userId INTEGER PRIMARY KEY AUTOINCREMENT, userName TEXT UNIQUE, userPassword TEXT)";
Future<Database> initDB() async {
final databasePath = await getDatabasesPath();
final path = join(databasePath, databaseName);
return openDatabase(path, version: 1, onCreate: (db, version) async {
await db.execute(users);
// await db.execute(noteTable);
});
}
}
Everything is working fine, but how can I open it outside the application?
Where will it be located?
It will located in the data/data/<the_package_name>/databases folder.
Everything is working fine, but how can I open it outside the application?
The file(s) are in protected storage so normally they cannot be accessed outside of the App. If using an Android Studio emulator then you can access the database via App Inspector or via Device Explorer (which would allow the file(s) to be copied).