This is a migrated thread and some comments may be shown as answers.

Sqlite Prepopulated DB

1 Answer 93 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shawn
Top achievements
Rank 2
Shawn asked on 28 Mar 2013, 06:40 PM
Has anyone used an existing sqlite db in a Icenium project?  I have a db that I created with the sqlite firefox plugin and I want to copy it to my project.  The db file needs to be copied to the correct spot in the file system to be picked up by app.  I found instructions here:

http://www.raymondcamden.com/index.cfm/2012/7/27/Guest-Blog-Post-Shipping-a-populated-SQLite-DB-with-PhoneGap

I'm wondering if anyone has done this and would be willing to provide some code samples. 

1 Answer, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 01 Apr 2013, 11:39 AM
Hello,

Currently the Cordova API does not expose a functionality for accessing arbitrary files in your application's directory. The blog post you have mentioned requires writing some native Java/Objective C code, which Icenium does not support at the present moment. The best approach we have found so far is to export your database as a SQL dump file and use an HTTP request to download and execute it the first time you run your application.

You can visit the following forum thread which answers a similar question:
Pre populated database for distribution.

Here is the link to the original blog post referred in the forum:
Creating a Database from a SQL Dump.

Hope this helps.

Greetings,
Ivan
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Kendo UI Dojo.
Tags
General Discussion
Asked by
Shawn
Top achievements
Rank 2
Answers by
Ivan
Telerik team
Share this question
or