String ValuesConfiguration File in Phonegap with JQM for android - android

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.

Related

Can I make an android app using html that recieves and stores values entered by the user?

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.

Creating offline android app using Phonegap and associated memory limitations

We have a very strong base of iOS apps and salesforce running at the backend. I am trying to get the similar app running on Android but using PhoneGap (not going native).
I had few questions about this:
Does PhoneGap put any limitation on how much RAM can be used for an
app? If yes, how much?
Our iOS apps tend to consume upto 100MB of memory when multiple views and data are loaded in the app, is this feasible using PhoneGap?
CORE data gives me a nice GUI to design my local storage, how can that be achieved in Android?
Is there any way I can import the exact data model from iOS to android?
I spent quite some time searching this but did not get any satisfactory answer. All your help is much appreciated.
PhoneGap doesn't put any limits on how much memory is used. If there are any sort of memory limits it would come from the OS itself.
If you can build it as a website, you can build it with PhoneGap. The only thing to watch out for is if you don't manage your DOM structure you could actually crash the WebView, but if you manage it well you should be fine.
Unfortunately with PhoneGap, especially with offline apps, the only two options you have are localStorage and Web SQL.
AFAIK there is no way of exporting the data model to Android that would be usable with PhoneGap. The closest would be to go though and try to recreate through one of the storage options I listed in 3 that are supported and well documented with PhoneGap.

Is PhoneGap the right choice for me?

I am new to PhoneGap, and I have several questions:
I need a way to develop an application that will have iOS, Android, and other platform compatibility. In other words, I want to write 1 app and get compatibility versions for different platforms.
By reading the "Get Started" guide linked by the PhoneGap website, I found there are different procedures for different platforms. So to have compatibility versions across platforms, do I have to go one-by-one and change all of them if I make a modification to my app?
Also, what exactly is PhoneGap Build? It seems like I can avoid all that hassle mentioned previously and toss my app into the PhoneGap Build? Do I really not have to do anything besides writing the app? What if I need to make changes?
And finally, I've read that PhoneGap works with HTML, CSS, and Javascript, but not PHP. What if my app needs to contact a server? Can PhoneGap handle that?
Thank you for bearing with all these questions!
PhoneGap achieves platform compatibility by embedding a webview within your application. Therefore you can apply your knowledge in HTML, CSS, JavaScript and it additionally provides ways to interact with native features (e.g. camera, gps, ...).
With PhoneGap you write one general web app, tweak parts for the specific platform (sometimes you do not have to this at all) and build it for that platform. The latter can be handled with PhoneGap Build service: It takes your webapp and bundles it for the mobile operating systems out there (Embeds it within a Java app on Android, an Objective-C app on iOs)
PhoneGap is able to communicate with a server hosting a PHP script just as every other web application. Trying to dynamically load resources from remote sites can be quite a hassle but this is another question.
traumalles is correct. All your HTML/Javascript/CSS is running from within a webview on the device. Your code is, therefore, all "client-side." You can communicate with a server just like with any other page. When they say PhoneGap isn't compatible with PHP, they mean only that PhoneGap can't execute PHP code like it's a server, because it's not. It's just loading your webapp in, basically, a browser.
One other important question is what exactly do you mean with "other platforms" phonegap does provide many functionality for nearly every platform but the different webbrowser of the mobile devices have their problems and limitations.
For example are there many problems if you want to provide your application on a WindowsPhone Device because the Webbrowser has a few limitations which will cause your app to not look and behave like a native app.
Just look a bit through the phonegap API you will see that some functions are just available for IOS or for Android and there are a few only Blackberry methods and so on.
So you really have to be careful when a framework tells you it will work on all devices.
So i really don't have a problem with phonegap i worked with it very great but there will be limitations you have to deal with.
If you primarily want to develop for IOS and Android you can really achieve great native like results !

Does it make sense to write an offline mobile web app in html5?

I am investigating options for a web app aimed at mobiles and one of the options is to write a standalone app that does not connect to the internet at all. Does it make sense to consider using HTML5 for this? The main reason for considering HTML5 as far as I'm concerned is the fact that it works cross-platform, but I just don't know if it makes any sense to consider this option if it will only be used offline once it has been initially downloaded.
Thanks in advance for your help!
As mentioned, this is definitely possible. I think the other answers don't quite give enough information, or understand the question, so let me provide a bit more.
Yes, it is possible to create a mobile app in HTML, either from scratch by using PhoneGap as the platform, or by using a mobile framework such as jQuery Mobile.
PhoneGap allows you to create true mobile apps using HTML5, CSS & JavaScript, and utilising the PhoneGap API to utilise features found in smartphones such as a camera, motion sensor, gps, storage etc.
Using jQuery Mobile, you'll be creating a mobile website, which must be accessed using the phone's browser, however you are able to incorporate this framework into the PhoneGap platform. This allows you to create a more native feeling app in HTML5.
I think the question you should be asking is what language should I use?. It doesn't matter if the app is used online or offline. What matters is what language or platform you want to write it in. There are downsides to using HTML5 to write mobile apps (speed, scalability, quality, approval to name a few).
I don't see a problem for doing so. HTML5 gives you ways to store information locally and a big set of other functionnalities. This could help you find if there is what you want regarding the mobile browsers (and Androïd's): http://caniuse.com/#feat=namevalue-storage
Then you may look into MVC frameworks like dojo toolkit (if you want widgets out of the box), backbone.js and so on.
Yes, it's possible. in fact many cross platform app out there is using HTML5 or javascript.
you could take a look on phonegap.com. It's cross platform using html5
Yes, it's perfectly possible to create an application with HTML5 (and javascript if needed).
Coding your app in HTML5 makes it easier to port to other mobile OS.
Just keep in mind that HTML5 is not definite yet, so you MAY have to rewrite certain parts after some time.
Phonegap can be used for this, as some already suggested.
If you're comfortable with java, but just want a HTML5 app so you can port it later,
you can use Google GWT (which converts java into HTML5 and javascript)
It's possible, but I don't think it's the best choice for an app that won't connect to the web at all. HTML5 offline apps are designed to work for the short periods of time where there is no web connection, not really for apps that will never connect to the web. Plus, HTML5 local storage is limited. I'm not sure what the limitations are off of the top of my head, but I think you'd be better off taking another route.
Definitely! There are already developers looking into it. HTML5 has native like capabilities, such as writing to its own DB and etc. Like they said, HTML5 is not definitive yet, so it might take awhile for it to be feasible and adopted by all.
Imagine 1 language to rule them all :)

Local database on Android tablet

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..

Categories

Resources