We need to have some kind of app that we can deploy to an Android tablet. The app must be able to run without internet. We need to have a database, preferably SQL.
I've been researching the options on how to create a mobile app with local storage and the options are not good.
The W3C standard is Indexed DB. But this is ugly and cumbersome code. It seems like it would take forever to create a large app.
Web storage is a little better
We'd like to use jQueryMobile and wrap it in PhoneGap. Is there a way to install a local server on an Android tablet so we can incorporate PHP and MySQL? I can't find anything.
There's LocalStorage in HTML5, but I'm not sure if that's the way to go. It is the simplest to code, certainly.
What are your thoughts? We'd like to use jQueryMobile and PhoneGap so we can deploy to an iPad if we ever decide to go that route. That's why I didn't include a native Android app with an SQLite database. Or would this be a better way to go (assuming we don't want the iPad option)?
Please let me know when you get a chance. Thanks.
PhoneGap does support local storage in SQLite and hence that is what I would do. Then you can also use the same db working on iPad or migrate to a native application if you find the web approach to be lacking..
Related
Basically, I'm trying to make use of this website called PhoneGap that recives html codes and converts them into mobile applications.
So I'm trying to make an application that tells you how much money you owe people and how much money people owe you.
IS this possible?
HTML alone isn't enough to develop your application. It's a simple mark-up language and unable to create any real functionality. But HTML if used together with javascript (which adds the required functionality) will work great for building what you mentioned.
So if, for any reason, you'd prefer to not develop a standard native application (one which is installed locally on a user's device), then another option is to build a web-based application. These have much in common with typical websites (though optimized for mobile devices) and are generally easier to build. Another advantage is that they can run on almost any device that has a browser installed, and therefore not tied to any one specific OS, such as Android. Web applications - despite not being installed on the user device - can none the less make use of local storage to save data. This is one example for when javascript is needed.
Here is a great resource for learning about javascript: http://www.w3schools.com/js/
You should read about HTML5 and hybrid apps. A hybrid app is what you are after.
Yes, you can use html to build an app with Phonegap, but you'll need JavaScript too.
I suggest the following technologies for you: Ionic, Angularjs and localStorage for recording the data.
I need to create an application that does the following:
Is available for Android and iOS devices primarily, Windows phone support would be nice
Allows the user to use the app offline
Allows the user to download files (PNGs and HTMLs) from a webserver to be displayed later within the webapp (needs to be able to be viewed offline)
Doesn't require user to redownload all the PNGs and HTMLs if they clear their browser cache (would be nice if there was a way to keep them from clearing the web app cache too, but I understand if this is not possible)
What tools do I use for this? So far, I'm at HTML5 web app and I understand how to cache the site, but how do I get the files (PNGs and HTMLs) to be saved locally and not subject to being cleared should the user clear the browser cache? Is native for iOS, Android, and Windows the only way to go here?
Any help is appreciated...
If you want your app to work on multiple platforms and be available offline, your best bet would be to wrap your app in something like PhoneGap and package it up for the various platforms.
This allows for one common "HTML-based web app" code base but will require compiling for the different platforms respectively.
I am a newbie to Sencha Touch, and we need to build a cross platform mobile application which involves upsync and downsync of quite a large amount of data through REST Web Services as background servies in Sencha Touch and if internet is not available data has to be stored in local sqlite db and after connecting to internet, data has to be synced. I have googled it but didn't get enough information on this. Can someone please guide me how to achieve this?
Thanks in advance.
There is no direct way of using SQLite in Sencha Touch. However, you can indeed use Phonegap to achieve SQLite DB connection in your Sencha Touch application. This should be fairly easy to accomplish. You can also look into Localstorage or WebSQL feature in Sencha but I am not sure that suits your requirements.
Here are some helpful links:
http://hansjar.blogspot.in/2013/04/how-to-easily-add-prepopulated-sqlite.html
http://druckit.wordpress.com/2012/11/16/using-the-sencha-touch-2-1-sql-proxy/
1) I am a newbie to Sencha Touch, and we need to build a cross platform mobile application
You need to start with sencha docs and start building some simple application.
Learn Sencha Class System
In sencha framework folder there is a examples folder you can find many examples there, use that to start leaning and experiment with it.
2) which involves upsync and downsync of quite a large amount of data through REST Web Services as background servies in Sencha Touch
Then, You need to know some more specific concepts like Store and MVC Pattern
If you are not familiar with MVC then
MVC in Depth Part 1
MVC in Depth Part 2
Useful SO link
3) if internet is not available data has to be stored in local sqlite db and after connecting to internet, data has to be synced
I think there are two ways
1, If your going to use PhoneGap (i am using it), You can do it by using PhoneGap connection feature to check internet is available or not, if not then there are ways to store data in local sqlite db in sencha.
2, I think sencha touch itself has device connection check feature (i didn't use it yet) to check internet availability and if not then as i mentioned above you can use local sqlite db.
So start trying and if you got stuck post here. you will get help from me and my fellow SO users.
We are building the same kind of application. You will need to use Phone Gap to communicate with sqlite through Sencha Touch. But Sencha Touch store couldn't directly use phonegaps functions to insert/select data into/from sqlite. You will need to use sqlite storage proxy for store in Sencha Touch.
ST's built-in Ext.Connection.IsOnline() seemed a bit flaky to me (there are reports on the ST forums that it shows a connection when a phone is in airplane mode or when wifi is disabled on a pad; in my experience it seemed to be able to detect the presence or absence of an access point, but not whether the access point had Internet access), so I went with cordova (phonegap) for checking online status.
You could maybe also set a fairly aggressive timeout on your request and see if the response.status is 0 (though that doesn't necessarily mean you have no Internet connexion: http://www.w3.org/TR/XMLHttpRequest/#the-status-attribute
As for SQLite, I used shepsii's proxy (http://www.sencha.com/forum/showthread.php?195991) for some time with success on both iPad and Android. Having read that ST's Sqlite proxy is now stable in version 2.2.1, I recently switched to using that 'official' version. Whilst it works fine on an iPad, on my Android tablet the app now hangs at the loading screen. As yet I'm not sure if that's due to the proxy or to something daft that I've done, but be wary.
In my Win8 version of the app, I just used a bunch of JSON files which can be stored in the user's local or roaming storage. For my purposes it seemed to be quite easy to mimic SQL queries using that approach, so I'm thinking of adopting the same approach in ST. The only problem is that I don't know where to put the JSON files.
I have used the following plugin for Background and Timer Services.
https://github.com/Red-Folder/Cordova-Plugin-BackgroundService
and I have used phonegap api for accesing sqlite.
http://docs.phonegap.com/en/1.2.0/phonegap_storage_storage.md.html
I am developing app for android using Phonegap with JQM. In J2ME app development , We can have centralized file ( message.txt ) we store list of string values which we are going to use. Like that can we have some configuration to get the string values from configuration file. So that we can easily do changes on text values. Could any one tell me.
Is it possible .?
There are numerous solutions, you only need to choose one that best serves your purpose.
Javascript solutions
All javascript solutions use localstorage as a final storage destination. Only difference is in their implementation, how far did they went to make it easier.
Lawnchair
Probably one of most commonly used JSON localstorage frameworks, also a framework of my choice. It is fast but probably a little bit confusing first time you see it. But with everything in mind it works very well.
Persistencejs
This is an another great solution. Best suited for mobile devices, but still made to work on broad specter of mobile devices (Android, iOS, BB) or desktop browsers. No matter which device is used it will use best storage available ranging from HTML5 WebSQL up to localstorage. This is an excellent solution if you want an easy way into WebSQL but it is a bit harder to work then HTML5 WebSQL.
localStorageDB
This one is a newcomer. Easy as Lawnchair but more SQL like. Like Lawnchair it uses only localstorage to store serialized JSON string. It will not work with webSQL.
Native support
Here you will also find fa few possibilities. A little bit better solution then JS frameworks, mainly because it used mobile phones native storage support.
Phonegap Storage
This is a official Phonegap support for local SQL storage. This is a commonly used functionality. But be warned it can be a little bit buggy. There's a support for every possible mobile platform except WM7+.
Cordova/PhoneGap sqlite plugin - Android version
Native interface to sqlite in a Cordova/PhoneGap plugin, working to follow the HTML5 Web SQL API as close as possible. It doesnt suffer from 5MB limit and it mimics classic SQL usage as close as possible. One thing to mention, it supports data encryption. Unlike common Phonegap Storage implementation this one supports Windows Mobile but BlackBerry is not supported.
Phonegap File
If you want to stick with files this solution is probably the best one. It is a common Phonegap solution. Store your configuration inside a XML and play with it in Java or Javascript.
Yeap, its possible to keep some string values in PhoneGap.
Since PhoneGap is based on HTML5 technology, you can make use of web storage (sessionStorage, localStorage) to store values.
Alternatively think of using native storage feature of the devices. You can store some config values in sqlite db and retrieve it when necessary.
My goal is to replicate my CouchDB to Android to allow offline access & reduced latency.
I watched this video:
http://www.youtube.com/watch?v=3RdcKWYGqig
One fundamental point I don't get is:
Does CouchDB replication work only
for Android Applications?
Or, can it work for a web application
running in the Android browser (this
is what I am shooting for)? If so, how?
you would need to install the CouchDB software on the Android device in order to get it to work.
Once that is installed, the user can visit your app via the browser at http://localhost:5984/path/to/my/app
You could create one of those bookmarks that looks like an app, and point it to the local couch url.
Chris
Ofcourse you can create browser based applications.
Either try creating a couchapp and loading it with the browserview in android or club it with something like Sencha to wrap it around and making it a hybrid native web app!
If you know how to create couchapps, then it should be pretty straight forward, else, take a look into how to create simple couchapps. Ofcourse, i'm going under the assumption that you already know a bit of Android!