Phonegap on android support localstorage? - android

My question here is twofold:
1) Does Droidgap (or Phonegap for Android) support localstorage in the browser. Does phonegap simply make use of android's native browser (and if so, does this mean it supports html 5 local storage?)
2) Is there a way to debug an html5 webapp running on the phonegap platform in Eclipse? I'm running my application and it fails everytime I send a request to my server, however I see no error in logcat...
Thanks a lot!

Yes Phonegap supports localstorage, as you can check here
http://docs.phonegap.com/en/2.0.0/cordova_storage_storage.md.html#localStorage
Your javascript output should all appear in logcat.

PhoneGap does indeed support localstorage.
I was able to receive logs from my app by inserting log statements in the HTML/Javascript itself and look at the config files server-side. Thanks

Related

A web based phone app with online and local html files

Hello i am working on a mobile magento theme. What i am looking is to embed or either cache the html, css and javascript files (do not know which is better!) to the application (local storage on phone) and retrieve the product catalog and related pictures from the database and online servers
My intention is to make the app have minimum load on startup and shows as normal native apps
Can you give some guidelines and routine to do so .
Thanks you.
You can either give PhoneGap a shot (http://www.phonegap.com), or try it yourself, since PhoneGap is nothing more than some small libraries to make native function (notifications, vibrating etc.) available for JavaScript calls.
If you just want to wrap your site into a native app, you can just put it inside a WebView, which runs exactly like the native Android browser.
If you want to use your html, css and js files to create an android app then the easiest way to attempt this is http://phonegap.com/
However, I would strongly urge you to build a native app (on Android) as Phonegap comes with tons of problems and less support.

Accessing device native features in cordova webview

I am making a Hybrid Application using cordova-cli. My requirement is that the first page in my application must redirect to a website. The entire data required for the application will be loaded into this website from some other data-sources.
The requirement is to access device native features such as camera, accelerometer etc. from pages on this website.
I am using
location.href="http://www.example.com";
to open the pages. I need a unified cordova.js file with all the plugins embedded into it.
Currently I am putting the individual plugins into the lib\android\plugin\android and by using the grunt -f command from grunt-cli, the cordova.js file recieved for android does not seem to produce expected results.
Can't be done I am afraid - because of the way Cordova interacts with the device.
What happens if, using a non-mobile device, you accessed the same website from elsewhere? The website will not know what on earth Cordova is.
Cordova interacts with the native code on the device, so requires this to handle the passing of JS-to-native, and vice-versa.

Cordova features aren't work on server

I am a developer of DisciplineXgames! We are developing a mobile app. We have downloaded the Cordova test suite from here (https://github.com/apache/cordova-mobile-spec). When I upload this on DisciplineXgames server it shows an error in alert box "Error: Apache Cordova did not initialize. Demo will not run correctly." but when we upload the same folder on Phonegap server it works perfectly fine. Unfortunately this doesn't solve our problem as we are building our mobile app on our server and just using Phonegap to redirect the user to the page hosted on DisciplineXgames server if there's Internet in the user's mobile.
First error which I got in the console area in Google Chrome is cordova.js missing when I provided that than it outputs another error that is cordova/channel is required.
Hope you can guide us through how we can use Cordova's amazing features on our server instead of Phonegap's local server.
I am a bit confused as to what you are trying to accomplish here but I am going to take a stab.
You want to develop an app that when the app launches, it checks to see if the device has internet connectivity. If it does, then the app just opens the mobile website hosted on your servers. if there is no internet connectivity then the app ???
Since this is a very simple use case for an app, I would avoid using cordova and instead use PhoneGap Build. Simply write an index.html page and a .js file to check for the connectivity and then use the inappbrowser plugin to open your mobile site if there is connectivity. Once that is done, zip your package, upload to phonegap build and then download your compiled apps.
phoneGap Build allows you to avoid the app building overhead and the need to install things BUT prevents you from taking advantage of some of the deeper configurations and some plugins. But again, for your simple use case, PhoneGap Build sounds like the way to go.

Beginning phonegap for android

I am new to phonegap and android, I have create a hello world application this link and it worked, but I don't know what 's the next step. I try to read API document from above link but it isn't easy to understand. For example, I don't know how to communicate between android code and js (how can I call android method from javascript and get value from android code to display in hmtl). I know ajax, but in this case I don't know how to use it.
So, I 'm looking for phonegap android ebook or a complete documents and tutorials.
Any help would be appreciated.
You dont need to bother about android methods in phonegap. Phonegap has its own method to write a android application. You can just use Jquery mobile along with phonegap to built apps. Basically phonegap is a container for jquery mobile helps to built apps with in built style and user interface and also it has own method to interact mobile device with their own methods.
just go through this following documentation and you will get a better idea about phonegap and jquery mobile.
Phonegap UI development with JQuery Mobile
Phonegap Working Examples

How to convert a coldfusion website into Native Mobile application

I have a coldfusion website running in my server.I have to develop an Mobile application say for iPhone/Android.(I am not mentioning mobile website).
I dono much about the native mobile development however I guess there is a possibility to achieve using phonegap and other cross platform dev tools.
Please suggest me how would I convert my website to native installable mobile application?
PhoneGap will allow you to convert a html application.
However ColdFusion is a serverside generated HTML and thus cant be converted using PhoneGap unless the entire application is html with ajax calls to ColdFusion for the data.
I dont know of any technologies that will allow you to convert a server generated html type language to a native app, I dont believe one exists.
You can also use Appsgeyser.com for convering your HTML website into an app. All online and no SDK to install.

Categories

Resources