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

How to Pass ISACA CGEIT Certification Exam Dumps Practice Test

ISACA CGEIT certification is mainly targeted to those candidates who want to build their future in IT Governance domain. CGEIT exam can provide those within an information technology related governance field with great benefits, both with potential employers, and unlock a network of like-minded individuals. ISACA's Certified in the Governance of Enterprise IT (CGEIT) exam certification is framework agnostic and the only IT governance certification for the individual. CGEIT can put you in the role of a trusted advisor to your enterprise. CGEITs maintain an adequate level of current knowledge and proficiency in the field of information systems audit, control and security. The technical skill requirement of CGEIT is that the candidate has relevant professional work experience supporting organizational enterprise information technology. CGEIT is a vendor-neutral enterprise IT governance certification which can help take your career to new heights. Free Exam Practice Question and Answer...

Jual Rumah di Prapanca Raya

Jual Rumah di Jalan Utama Prapanca Raya Rumah yang berlokasi di jalan utama Prapanca Raya ini sangat cocok digunakan selain sebagai hunian dapat juga digunakan untuk Cafe / Restaurant atau menjadi kantor. Bangunan dan struktur rumah sangat terawat rapih karena selalu ditempati keluarga Adapun spesifikasi singkat sebelum anda serius untuk mengetahui detail lebih lanjut dengan menghubungi kami adalah : Heritage house Luas Tanah :  378 m2 Luas Bangunan : 200m2 (dimana Lebar bangunan belakang lebih besar dari bangunan depan - ngantong Sertifikat Hak Milik (SHM) Listrik 10,000watt Telp 2 line Jumlah Lantai : 1 4 km tidur 2 km mandi + 1 km tidur & km mandi pembantu . Rumah 1 lantai. Air : Sumur pompa & PDAM Harga : Rp 29,9 Milyar (Tanpa Perantara) Rumah kami jual tanpa perantara , dan dengan segala hormat mohon untuk tidak menjadikan iklan ini sebagai peluang untuk menjadi perantara karena kami menginginkan proses tawar menawar dan transaksi penjualan rumah yang penuh i...

ISO 27001 Trainer pelatihan training di Bali, Jayapura 2018

ISO 27001   Trainer Mr. HERY PURNAMA – 081.223344.506   www.inhousetrainer.net   adalah #trainer #freelance 2018     # Bali, Jayapura   untuk training #pelatihan   ISO 27001   terkenal di indonesia dengan pengalaman lebih dari 17 tahun di bidang IT dan sertifikasi internasional , selain corporate trainer Hery Purnama juga terkenal sebagai IT Enterpreneur , pengusaha dan Motivator Bisnis (motivational speaker). Topik training lainnya     yang Hery Purnama 081-223344-506   www.inhousetrainer.net   kuasai antara lain   sebagai trainer     ISO 27001   ,   ITIL , CISA, PMP, PMBOK , PMO, COBIT, EDMS, BABOK, DMBOK, SAD UML 2.0, SQA, PRINCE2, CRISC, TOGAF, ISTQB, RDBMS Concept, e-LMS, KMS, SCM, TRAINER ISO 27001, ISO 9001, ISO 20000, ISO 38500, INDEKS KAMI, SEO Internet marketing, IIOT, SIX SIGMA, APACHE HADOOP SPARK, TRAINER BIG DATA, DBA ORACLE SQL SERVER MYSQL MARIADB POTGRESQL, MICROSOFT PROJECT, PRIMAVERA P6, PROJECT LIBRE, QGIS, ARCGIS, ASP NET, TRAINING VB NET, PHP, JSON, XML. SOAP,...