user1364743
user1364743

Reputation: 5641

How to deploy Cordova application on multi-platform?

I'm beginner in Cordova framework. I wanted to know if I develop, for example a HelloWorld application in Eclipse with the Android SDK, if this one will work in IOS platform ? (I think it's not the case). But it said on the official site that Cordova is a framework using JQuery, Html and Css. I've downloaded the framework and I have a exemplary of this framework for all platforms. So if I use the android one and I code my HelloWorld appication with it, my application will only work on Android phone, right ? So, if I want to make both an Android and IOS application I will have to make two differents programs ? Is there a possible way to have the same program for all platforms ? I'm really lost.

Thanks very much in advance for your help.

Upvotes: 1

Views: 4741

Answers (2)

dpfauwadel
dpfauwadel

Reputation: 3934

With phonegap, you will have for each project (ios, android...) a www folder. Inside this folder, you can developp your application using html, css and javascript. If you want to export you app from android to ios, all you have to do is to copy this files in the www folder of you ios project. Just don't copy the cordova.js (this one is different for each project).

Hope this help ;)

Upvotes: 1

MBillau
MBillau

Reputation: 5376

Please see my answer for a similar question here: Beginning with Apache Cordova

Basically, you create your app in JQuery, HTML, and CSS. You use the Cordova JavaScript API's to access device functionality that usually you could only get by creating a native app in C# or Java, such as access to the device camera or Contacts. You will need the Android SDK to actually "compile" your HTML/JS app into an Android app, and you will need XCode to "compile" into an iOS app. You will not necessarily need the Android SDK to create a Cordova app unless you want to build Cordova plugins to extend the base Cordova API. However, it helps a lot to have the SDK and Eclipse set up in order to test your app on a real device.

You can use a free (for now) service called PhoneGap Build to "compile" your HTML/JavaScript/CSS into the multiple different native applications instead of downloading the various SDK's yourself. However, I'm not sure how easy it would be to create an app without continuously testing on a native device.

You are correct that the HelloWorld application that you build with Eclipse and Android SDK will not work on iOS platform. However, you should be able to take the exact same HTML/JavaScript/CSS code, paste it into XCode (the Apple version of Eclipse), and create an iOS app without any changes. So you can code everything on Android and use Android to test, but then porting to iOS should be very simple assuming that you only write your app with HTML/JS/CSS.

Upvotes: 0

Related Questions