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

Training PHP JQuery bersama PT.GSP bandung

Terima kasih kami ucapkan kepada peserta dari PT . GSP Bandung yang telah mengikuti Training PHP JQuery di SISINDOTEK Bandung Salam, SISINDOTEK - IT Training & Solution Provider 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

Training MS Project Secara Online - Hery Purnama

Home  » » Training Online Microsoft Project dan VBA Macro - Hery Purnama Training Online Microsoft Project dan VBA Macro - Hery Purnama 9:24 AM       No comments Mau tetap bisa training MS Project bersama Hery Purnama ditengah masa Panedemi COVID-19, tidak usah khawatir kini saya membuka kelas webinar  MS Project dan Excel VBA Macro (Senin-Sabtu) dengan 3 slot waktu 09.00-11.30 , 13.00 - 15.30 , 19.30 - 22.00 , book sekarang karena peminat sangat banyak sampai saat ini, hubungi 081-223344-506 Regards, HERY PURNAMA Certified IT Trainer http://www.inhousetrainer.net E-mail :  inhousetrainer@yahoo.com ,  hery.purnama@gmail.com  Call/ SMS/WA :  081.223344.506 , BBM : 7DC633AA      Social Net :   facebook.com/inhousetrainer   twitter.com/inhousetrainer   instagram.com/inhousetrainer Hometown : Bandung - Jawa Barat

WHAT IS COBIT ISACA

What is COBIT? COBIT stands for Control Objectives for Information and Related Technology. It is a framework  created by the ISACA (Information Systems Audit and Control Association). It was designed to be a  supportive tool for managers—and allows bridging the crucial gap between technical issues,  business risks, and control requirements. COBIT is a thoroughly recognized guideline that can be applied to any organization in any  industry. Overall, COBIT ensures quality, control, and reliability of information systems in an  organization, which is also the most important aspect of every modern business. Cybersecurity Expert Master's Program Master the Skills of a Cybersecurity ProfessionalVIEW COURSECybersecurity Expert Master's Program What is ISACA? ISACA stands for Information Systems Audit and Control Association. It develops controls and  guidance for information governance, security, control, and audit professionals. This i...