Pre-written database (Phonegap/Cordova + sqlite)

Asked

Viewed 202 times

1

I am developing an App using Phonegap/Cordova and Sqlite, but along with the application it is necessary to go a database containing approximately 50MB of text information. I’m using the app "Phonegap" android to test the application, but I have no idea how to put the information (50MB) text in the database sqlite(plugin).

When I installed the plugin (Sqlite) I did not find any database file where I could open it with a manager and enter the information manually so that when I did "Buld" it would stay in the App.

It’s been two weeks since I’ve been able to find that information?

  • Do you want an SGDB for sqlite? Proccure by sqlite studio or databasebrowser. There are several that are compatible with sqlite.

  • Intendo, but is the following my friend, how do I locate the database file within the Cordova/Pronegap project? The file is inside which folder? and what is its extension?

1 answer

0

I can’t comment later if I have to. Usually after you compile the project and if you are creating the Sqlite database upon launching the application, the path to the database after created would look like this on your device.

/data/data/com.phonegap.helloworld/Databases/Mydatabase.db

To know the path where your app was installed just type this in the terminal (Linux). with your device in debug mode and connected to the pc of course.

To access the device via terminal:

adb shell

Return the path where the app is installed:

run-as "com.nome.nomepp"

Then just enter the folder /Databases and there will be your file ". db".

Although I don’t think it’s necessary to include it manually as I understand it. you can create an insert script for when the app starts for the first time it will insert this data into the table.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.