Skip to main content

How To implement a sqlite database in phonegap

'm implementing a cross platform app for Android, iOS, and BlackBerry. I'm using PhoneGap to produce native language versions for each platform. I want to know how to create, access, and search a SQLite database.

I've read in the documentation that it can be created via a Javascript file but I want to know where to place that file & how to refrence it in the code.

Answer :

Take a look at Lawnchair (http://brian.io/lawnchair/), its pretty easy to use and out-of-the box probably does most of what you need (including searching), its cross-browser, battle tested and degrades nicely through the use of adapters. There is an adapter for Blackberry, and a plugin that support queries. Here is quick example using the webkit adapter, which is good for Android and iPhone, to show how simple it is.

<script type="text/javascript" src="Lawnchair.js" charset="utf-8"></script> <script type="text/javascript" src="webkit-sqlite.js" charset="utf-8"></script> // Open local DB connection var lawnchair = new Lawnchair({table:'mytable', adaptor:'webkit'}, function(){ // Lawnchair setup! }); // Getting some data out of the lawnchair database lawnchair.get('my_data_key', function(obj) { if (obj !== undefined) { lastSyncDate = obj.lastSync; dataList = obj.dataList; } }); // Saving to the database lawnchair.save({key:'my_data_key', lastSync: currentTime, dataList: someData});


Quoted by :



SISINDOTEK - IT Training & Solution Provider

Office 1 : Jl. Pelajar Pejuang 45 No.23 , Lt.2 Bandung - Jawa Barat

Office 2 : Jl. Sukasenang VI-6B Bandung - Jawa Barat 40124
Tel. 022-71242266, SMS. 0812.8733.1966
info , YM. sisindotek
www.sisindotek.com , facebook.com/sisindotek , twitter.com/sisindotek

Comments

Popular posts from this blog

Laravel Training Purnama Academy

Nov 2018 Purnama Academy 0838-0838-0001 Kursus Laravel Training Center INdonesia, jakarta, Bandung, Bogor, Semarang, Yogya, Palembang kalimantan, surabaya visit www.purnamaacademy.com , Laravel - Online Courses, Classes, Training, Tutorials on Lynda https://www.lynda.com/Laravel-training-tutorials/2779-0.html Learn how to use Laravel, from beginner basics to advanced techniques, with online video tutorials taught by industry experts. Top Laravel Courses Online - Updated November 2018 | Udemy https://www.udemy.com/topic/laravel/ Whether you're interested in developing web apps in the Laravel PHP framework, or building a RESTful API with Laravel, Udemy has a course to help you ... PHP Laravel Framework | Brainmatics.Com brainmatics.com/php-laravel-framework/ Translate this page Laravel merupakan framework PHP yang dirancang untuk membangun situs web ... Pada training ini diharapkan mampu membantu meningkatkan kemampuan ... Dec 3 - Dec 6 Brainmatics Laravel training - Laracasts htt...

TRAINING SQL Server 2017 DATABASE ADMINISTRATOR-BANDUNG

TRAINING SQL Server 2017 DATABASE ADMINISTRATOR By Purnama Academy - Training Center January 18, 2018  No comments SQL Server 2017 DATABASE ADMINISTRATOR Syllabus Class Type           : Training Duration              : 4 Days (09.00 ā€“ 17.00) Training Description : Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applicationsā€”which may run either on the same computer or on another computer across a network Database administrators (DBAs) use specialized software to store and organize data. The role may include capacity planning, installation, configuration, database design, migration, performance monitoring, security, troubleshooting, as well as backup and data recovery Call us for detail syllabus ! ...

Download Slank Full Album lagi sedih 4shared

Untuk para slanker, salah satu album legendaris slank lagi sedih 1997, download gratis di 4shared.com http://www.4shared.com/get/HsDEfGc6/slank-lagi_sedih.html HERY PURNAMA Certified IT Trainer http://www.inhousetrainer.net , http://www.purnama.info hery.purnama@gmail.com , hery@purnama.info  Call/ SMS/WA :  081.223344.506    Blog :   inhousetrainer.blogspot.com   freelance-it-trainer.blogspot.com    Social Net :   facebook.com/inhousetrainer   twitter.com/inhousetrainer   instagram.com/inhousetrainer Hometown : Bandung - Jawa Barat Please consider your environmental responsibility. Before printing this e-mail message, ask yourself whether you really need a hard copy.