In my jQuery Mobile App i have created sQlite Database and all transactions work successfully , and I want to see the DB file, I searched for it in my project directory but I didn't found it? Does phonegap create file for the created sqlite DB? and where is it? how I can pull the DB file in order to see the inserted data?
I have searched over the internet but I didn't found any answer ,please help me .. since I am new in jQuery Mobile.
Thanks in advance.
Most likely your database is being created in android's cache directory. The following stackoverflow followup answer by the original questioner and it's backlink to an earlier answer should be all you need:
Using PhoneGap for Android : Not able to create table in the database
Related
I'm using a sqlite database linked to my react-native app.
I've already done some queries in my app that work fine, so the query method is good.
Now, I've add new table to the database by adding a csv file in it (as I've already done before).
But when I make a call on the new table, the console tells me that there is 'no such table'.
If I put the sql query in my DB manager, the call do works.
Thanks for your help!
I did find the solution.
It is very simple, just create a new emulator and rerun your app. It seems that Android Studio works on a 'copy' of the project so it does not see the modification in the database.
I’m new to ionic and in my Ionic Application, I need to store a pdf and image file in SQLite i.e in the app storage and should open within app. I will get the file from another database like MongoDB in the URL format. Could anyone of you help me out of this and suggest any references to complete the app storage using SQLite.
Thanks in advance.
I have researched on different aspects but could not find any.
My main goal is to import a database into a flutter app using sqlite(sqlflite plugin), instead of having to hard code all of the create tables into the apps code.
*I want the information to be accessed to the phone locally(access data from phone on airplane mode) that is why i am using sqlite
I am having trouble finding information on this online and was seeing if anyone had experience in doing this or has documentation/examples that could help.
i think you are looking for this :
Open an asset database in this case you must have the database already and you don't need to create tables
Flutter supports an open source module SQFlite. SQFlite is a way of storing app data in Flutter Application. SQFlite is a Database plugin for flutter. It is highly reliable and embedded Database engine. All the CRUD operation in the database will run on a background thread. You can see a simple example of this here.
I'm working on a Sencha Touch project and I'm in need to pack the app with a prepopulated DB. I'm using Cordova-SQLitePlugin (https://github.com/brodysoft/Cordova-SQLitePlugin) as a cordova plugin to use SQLite as a local DB and I've been looking around for ways of achieving my goal of prepopulating the DB but with no success. What I've found are blogs suggesting to copy the DB in a cordova folder and it's supposed to magically work but I haven't had any luck and I'm guessing it has something to do with my project being a Sencha Touch + Cordova project.
What I've done so far is run all the queries on the app's first launch and populate the app there, but the things is I have like 50k inserts to do so it really makes the code awful and I could spare the user the time it takes to do those inserts by packing the app with the DB ready to use.
Does anyone know a way around this?
Ok! Did it!
I got some help from a guy at Sencha forums and he pointed me to a repo he posted on github with an example of Antair's SQLite plugin for Cordova.
Here's the link to the repo in case anyone needs it: https://github.com/Yoinbol/SqlitePopulated
The DB is placed at cordova/www/db/ folder (db folder must be created).
There's a file named importdb.js at cordova/www/resources/scripts/ that listens to deviceready and loads the db when it fires. (I had to change importIfExists from false to true in here to make it work)
In the Main.js controller there's an example of how to open the DB in case anyone needs that too.
Anyway, hope this helps anyone in need sometime and thanks to Diego Garcia at Sencha forums for the help.
I'm in need of some help in developing a desktop application with a pre-populated database. I have tried numerous ways to get this working including those mentioned on both Tidesdk's API here http://tidesdk.multipart.net/docs/user-dev/generated/#!/api/Ti.Database.DB and at Titanium Desktops old API here http://developer.appcelerator.com/apidoc/desktop/latest/Titanium.Database-module.
While the later (using Titanium not Ti) works in creating a database in the apps directory it does not install my pre-populated sqlite database which is located in the resources file of my app.
A couple of my attempts located below
var db = Titanium.Database.openFile('test_db.sqlite', 'test_db');
var db = Titanium.Database.openFile(Ti.Filesystem.getFile(
Ti.Filesystem.getApplicationDataDirectory(), 'test_db.sqlite'));
var db = Ti.Database.open('test_db');
As stated most of these manage to create a database with the name given but when trying to run something as simple as a db.execute(SELECT) of something I know would exist in my pre-populated db I receive an error stating
Exception executing: SELECT name, id FROM people ORDER BY name COLLATE NOCASE, Error was: SQL Statement invalid or database missing
I have searched high and low for something to answer this but everyone continues to refer to the aforementioned API's or to the Mobile API's Ti.database.install() which does not work either.
Is it possible with titanium desktop to use a pre-populated sqlite database or do I have to populate it after I create it? If so any direction would be helpful (where to place the .sqlite file in the app and what functions to call).
I am currently using Titanium Studio with a titanium desktop osx SDK of 1.2.0.RC4 as requested by tidesdk.org until they have released there open source sdk.
Thanks in advance
This is possible, I just used this feature in a recent desktop app, deployed it successfully to Windows and Mac.
In my experience, sometimes your database file can be corrupted, for example if you use the Titanium.Database.install command, and it cant find the file to preload from (maybe the first time you specified the path wrong for instance), it will create the file itself, any subsequent install commands will not work because it already thinks this database has been installed.
Have you tried clearing out the application data? This is where titanium installs the database. For Mac this is in your /User/Library/Application Support/APPNAME directory. Their is a directory for databases, delete this and try again.
Also, this answer on Titanium Q&A may help, it talks about the process with the Mobile SDK but the Database stuff is the same.
Hope this helps!