android app with apache cordova

I'm developing a web app using HTML5,CSS3 and JavaScript. Then I want to use the Apache ordova platform to generate a native android app from my web app but I still don't understand what do I need for this,specially do I need a server-side development with php for example??


First off i suggest you read this Pretty much your app will be able to accomplish a little bit more than what you would be able to do in a browser if all you had available was the ability to write html/js*.

*by this i mean that you have access to device-specific hardware which is not available in a browser and a few more things but pretty much that's it.

You will need to install node.js (or io.js), then install cordova through npm, and make sure you have the Android SDK installed. Once you create your project, your html/css/js will be wrapped into a native webview component, you do not need any server to render it, effectively your app is a native app that can be installed from google play.

You will need a server, typically a RESTful API, if your app needs to query data remotely or persist to some third party. If you are thinking through a classic MVC mindset (render a page through some php code) then you probably need to read about cordova and how it works. A cordova app is a client-side only app, no server-side processing is possible unless through a network communication to a server you have access to on the internet. You can do persistence locally (to the android device) and even use a local database, but remember that this db exists on the device, so you won't be able to share information between users unless you somehow coordinate that through your app (and most likely a server-side app / rest api).

It is unlikely that your existing web app can be wrapped into a cordova app straight away, cordova apps are single page apps mostly.

链接地址: http://www.djcxy.com/p/66562.html

上一篇: AI为最终的幻想战术

下一篇: Android的应用程序与Apache科多瓦