Beginning phonegap for android - 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

Related

Migrate my E-commercial website on mobile phone platform using PhoneGap

I have just created a website based on prestahsop template (PHP + SMARTY), and I have made it work online.
Now I want to migrate the project on mobiles. I searched for several means of doing that, finally I am about to use PhoneGap for my solution.
But I have no idea if that can encapsulate the whole project on the mobile platform, and ideally be launched on Apple store. If not, I would like to get some advice to make changes.
Anyone having former experience can come to help? Thanks so much!
In addition to andre3wap response, you can use Prestashop Webservice API to link your application to your website. I've already done this in the past, the tricky part comes when you need to create an order in your Prestashop website from your application. But it's completely doable.
You will have to create an HTML + Javascript application with PhoneGap, that calls Prestashop via Ajax requests. If you want your application to work offline (and only create the order when the customer is back online) you will have to load every products on installation and sync when the app is online.
It's a lot of work.
EDIT related question: How to integrate prestashop with android?
If your web site only consists of HTML pages, yes; PhoneGap will be able to do most of the work(Just upload your HTML pages in a folder to build.phonegap.com for the conversion), there are other methods that can do the conversion, but that one is easier to me. (Read their documentation)
If your web site was created from a server side language, NO, phoneGap will not be able to fully convert it into a full fledged HyBrid App.
It gets very tricky when it comes on to Server Side scripting + phoneGap. What you can do is build html pages, and create "APIs" to load the data in the APP and use JavaScript to parse the data respectfully. (That phoneGap can handle)
You can read this article for an even more detailed explanation:
Usefull Article

How to achieve pagination in Android using jQuery mobile

I have seen some demos about the jQuery wizard plugin on websites. But all of these are based on the web, and run in the browser.
I want to use this function in my Android application, does anyone has experience with that?
Check out PhoneGap to convert a web app to an Android native app. See also some of our demos, videos and tutorials. Many of them demonstrate native Android apps built with jQuery Mobile.

Convert Mobile Web into Native Apllication Using WebView/phoneGap

I am gonna develop a mobile application for multiple devices, say iPhone, iPad and Android Devices like Samsung Galaxy, Samsung Tab and Samsung Galaxy Nexus,
The application is about listing set of information from webservice to list in the application, So I decided to go for Mobile Web app using jquery mobile,
I want to publish the app in Appstore and Android Market, So I want to wrap the Mobile web in to a Native app, I thought an idea of implementing it in a UIWebView in iOS and WebView in Android,
Another option I found out is phoneGap,which provide an SDk to wrap an Web app into a Native iOS or Android App.
Can you people suggest me , Is it better to go with WebView in your native application, or is it really required to use phoneGap, Whether apple will approve my Application if I am using Mobile Web app in a UIWebView, Kindly Suggest.
Note: In my application there is no real need of Using any native functionality of iOS like, Camera, Contacts etc, I just wanna have a list with information fetched from the Webservice.
If you don't need any of the native features phonegap/callback gives you, do not use it. It's a bloated project that will probably add a ton of features you don't need, if you only need a wrapped web application.
Just use a regular webview, enable JS, caching etc and load your HTML into it.
Use phonegap. http://phonegap.com/
If u use it you can use the phonegap build service to generate apps for all platforms via it. you will only have to worry about the js, html part of the app, like you said.
Or if you dont want to use the phonegap build, still creating your own apps with phonegap is way easier as you dont have to write ANY native code.
There were some issues in Phonegap before because of which Apple was rejecting Phonegap apps previously. Thats fixed now, so thats no problem. :)

iOS - calling a web application from within an app

I have a quick question regarding to mobile development, I'm new at this, so please excuse me if I have some mistaken concepts. The scenario and question is the following:
I have a mobile site developed under .Net Framework 4.0, MVC3, Jquery Mobile, HTML5, and CSS3 that looks and works really well from any mobile browser: iOS Safari, Opera Mobile, Android Browser and Blackberry Browser.
I would like to create an app that has a browser in it with the address bar hidden to show this web application and don't let the user see the web address of this web application. The reason why I want this behaviour is this: we have a banking web application site that is intended to be used only through the mobile application. We don't want to create separate apps for each platform, so we would like to use some of those multiplatform frameworks like Phonegap, Appcelerator or such.
I only want to know if it's possible to get this achievement on Phonegap or something like that.
Thanks in advance.
This can be done really easily using Appcelerator.
http://developer.appcelerator.com/apidoc/mobile/1.0/Titanium.UI.WebView
Code:
var webview = Titanium.UI.createWebView({url:'http://www.appcelerator.com'});
var window = Titanium.UI.createWindow();
window.add(webview);
window.open({modal:true});
However, if the app is only using that one webview and no other form of functionality, Apple could well reject it for not using any native functions.
See this note in their documentation...
12.3: Apps that are simply web clippings, content aggregators, or a
collection of links, may be rejected
Hope that helps!
if all you are going to do is host the app inside the webView then I would suggest that PhoneGap is better suited for that approach to mobile application development.
Appcelerator utilizes the native controls/ UI of the platform to build applications and since it is not your intention to use them it is just extra baggage.

How do I use webview to embed the web app in a native Android App?

I have a fully-working web app that is accessible using Android's browser.
The annoying part is the url bar uses a lot of the screen. Is there a way to make this web app a native Android app? I've read that webview can be used to embed a web site within the Android App.
Unfortunately, I only know web programming languages and have no Java experience. Will I still be able to do this on my own?
You certainly will need some learning in java, you can start with reading the following :
Webview documentation
A very detailled tutorial (quite hard if you haven't any java basics)
A basic tutorial on webview usage.
Have you looked at phonegap. It comes with a standalone app with a WebView embedded in it and with native android functionality support. You just need to provide your html/javascript app to it and you're done.
You can use a web app called MIT App Inventor
and get it done in less than 10 minutes, it's very easy, intuitive and requires no programming skills at all.
all you need to do is create a new project,
drag and drop a WebViewer component, on the right set the home url,
and your done! just connect to an android phone via USB to install the app
and you can even download the .apk to your computer, sign it and publish it on Google Play

Categories

Resources