I have been working on a simple database application for a small phonegap project. I have successfully implemented a websql database that stores a single table with some basic data. Recently I have been reading that this method is being phased out gradually due to some limitations. There seems to be an alternative using a webkit plugin for phonegap. This interfaces between the sqlite database on the phone and the front end.
So my question boils down to: What is the best practice when developing a database application using phonegap? Which technologies would you suggest? Any help is much appreciated. Thanks
Hi if it is larger database then go for Native sql plugin, if it is small then use HTML 5. HTML database They are fast, flexible and never expire.all of the queries are run via JavaScript, they persist until manually removed. but if the DB size is so large application must hang, so for much larger DB manipulation you can use Native Sql.and HTML 5 db Not ideal for sensitive information like password.
refer this may help you.
I suggest you to use a sqlite plugin. I have an application since android 4.0 using websql, and now, on the devices using android 4.4, my application stops working.
Don't commit the same error that I do. Use android native sqlite instead html5 websql.
Related
I've been developing an android app for the last year or so in android studio. It has been in the play store since October and quite a few people are using it.
I have received many requests to create the same app for iOS and so after a lot of research I've settled on xamarin forms as it will be easier to code (as I'm familiar with c# and xaml) and less work to maintain the app for both platforms at the same time (even though it will take a while to port the code over).
The android app is using sqlite for data persistency and the xamarin version will do the same.
My question is, how could I port the sqlite databases of existing users to the new app once it is released? Is there a way to define the table/column names the same as I have set them in the android studio version?
Currently the app has a feature to export the database to the Downloads folder and the xamarin.forms app will import it from there.
I haven't seen anyone in any tutorial explicitly define the table and column names in their xamarin.forms sqlite implementation so I'm a bit worried to take the leap.
Is there a way to ensure that existing databases will work out of the box once imported in the xamarin.forms app? If not, could someone please point me towards a piece of code that will migrate data from one dB to another?
Thank you in advance for your time.
Regards
As I got a bit more familiar with the SQlite package in Xamarin.Forms, turns out that the answer is as simple as adding the [Column("my_column")] attribute above the property in the model. This way it will name the column to whatever is specified in the brackets and I can make sure it matches the database schema I have in my current project from Android Studio.
a bit of a "duh!?" moment here for me but thank you to all who have taken the time to answer!
Hello I am developing application using phonegap, I want one Html page and i will put the button.
On click of that button it must fetch my sqlite3 database and just simple it must display to my next or same html page..
depending upon query.
Please anwer my question and what IDE I must use.....
To use sqlite3 on a phonegap application, you will need this Phonegap-SQLitePlugin.
However, the plugin has been designed for Phonegap 1.7 so you might need to upgrade it.
You don't need to use any plugin, as webkit already has sqlite available. I have written a data access framework to sqlite in phonegap, please check here.
It's quite easy to use, you don't need to write any sql scripts. It works very like asp.net entity framework.
I am currently working on an Android project and will have to manage database connection and queries to store data. I will not be working with SQLite as provided by the Android device and using it is not an option.
As I need to build quite a lot of queries I wanted to use a library or framework to make the task easier. Looking at what was available, it seemed easiest to use a framework such as, for example, QueryDSL.
However, since I am working on Android, I am not sure if the framework is usable and what using it would entail. Does somebody have experience using an external database with Android and have any recommendations?
The recommended way to connect to an external database is to use a REST client.
See this post
I'm getting started on a contracting project bid, and I was hoping for some advice on the best way to go about it.
I am being asked to develop an Android application for inventory management for a small company (no more than a few thousand SKUs at most) for Android tablets and I'm trying to come up with the architecture for the system.
I was thinking of using MS Server 2008 hosting a MSSQL database. This database would be exposed via REST services, as the DB would need to be accessible remotely (through Android tablets by salespeople).
I haven't used SQL much in the past, but I am thinking this is likely the best solution, along with REST for performing remote DB transactions.
Basically the functionality would be to view stock, order items, check prices, etc.
I would appreciate any advice anyone has on this topic.
Thanks!
I recommend you go over this article: Creating an OData API for StackOverflow including XML and JSON in 30 minutes. Then, consider the odata4j project.
Also, here is an interesting lecture about clienting REST for android:
http://developer.android.com/videos/index.html#v=xHXn3Kg2IQE
I would go for Oracle Application Express. They have build in Jquery Mobile and easy to expose a report list as Rest web service. Then use Phinegap and Jquery for Android apps.
Take look my quick sample: http://m.youtube.com/index?desktop_uri=%2F&gl=US#/watch?v=5rfuq-e-_Ws
You are not building an enterprise system....give a try Oracle Apex...you will be addicted to it.
Phonegap, Jquery Mobile and SQLite as local database on Android tablet .... Only if you need offline capability. Otherwise just use Oracle Apex with build in Jquery Mobile will be super solution!
I recommend you take a look at restSQL, an ultra-lightweight persistence framework. It currently supports MySQL and PostgreSQL. See http://restsql.org. It runs in a standard Java EE container, e.g. Apache Tomcat.
restSQL is not a conventional ORM. It does not present an object-oriented view of the database. It presents flat or hierarchical "views" of relational database tables. These views are query-able and updatable through a simple REST-based HTTP or Java API. The HTTP interface is based on REST principles, which use HTTP’s built-in features, rather than abstracting away from them.
I have used http://www.remobjects.com/ for this. Create the server in .net, delphi and clients in anything.
Also, is possible to use just http://www.remobjects.com/da/relativity.aspx if not have heavy logic in the middle-tier.
I am building a PhoneGap application for Android and iOS.
I want to know which one is a better selection for database management: HTML5's SQLite or Native database of device.
In case of native use, i need to build a plugin for interaction.
Please suggest me a better option according to performance and speed.
i have tested with a POC that Native DB of Android/iOS is too much faster then WebSQL (of HTML5), in case of a PhoneGap App we should use a plugin for Native database.
in my test; i have run 999 insert query in a PhoneGap App with Plugin for native environment and the results are:
in Android queries are 558% faster in Emulator, 275% faster in htc droid hd and amazingly 2327% faster for htc wildfire.
in iOS the results are just hilarious queries are 2k+ percentage faster in Simulator/iPhone 4 and 5600% faster in iPhone 3GS.
The Web SQL Database standard is no longer being developed. It will probably be replaced by IndexedDB. I wouldn't rely on its existence if I were you.
From the spec:
Beware. This specification is no longer in active maintenance and the Web Applications Working Group does not intend to maintain it further.
I don't know about native database, but HTML5 WebSQL is very slow on iPhone when using tables with hundreds of rows, mainly 3G, 4G is little better. On Android there is no problem running pretty nice queries - we thought it would be the same on iPhone but we had to drop use of WebSQL in our project and rewrite everything to JSON and many more functions which had functionality of a few simple WebSQL queries.
It's a shame that support of WebSQL is officialy dropped, but currently, it's supported on both Android and iPhone and it's very handy for some cases. So I hope and I think WebSQL will be maintened "not-officially" but still in Android and iPhone in future.
As for your question - my experience tells me, that it depends on your tables structure, how complex queries you have and mainly - how many rows you have in tables. If you have tens of rows, its OK to use WebSQL, but if you hit 100 or more rows in a table, it will get slow on iPhone.