D3GAN
D3GAN

Reputation: 640

convert phonegap App to iOS

I developed an android application with Phonegap and I want to port it to iOS as well. Is that possible? I don't what to do with my java files!? All I see in Phonegap sample project in MAC are objective C. How can I import my java files to XCode and compile them?

Upvotes: 0

Views: 1829

Answers (4)

taruna-systematix
taruna-systematix

Reputation: 111

Yes, you can surely port the Android code to iOS in PhoneGap. But there is one case where you may face the problem i.e. if you have used any plugin for Android, which will be a .java file, then you need to re-implement it for the iOS in Objective C code with same functionality.

But if you have not used any plugin code, then you would have just worked with the HTML,CSS and JS files, which are clubbed into one single folder, i.e. www. So you may copy that in the XCode project,and compile it. It will run as smooth as in Android.

Upvotes: 0

Jayprakash Dubey
Jayprakash Dubey

Reputation: 36447

The application that you have build on Android using PhoneGap can be executed on iOS device as well. Simply copy the content of 'www' directory of application in 'www' directory of Xcode and run it. This will build an required iOS App. The below image shows directory structure of PhoneGap App.

enter image description here

Upvotes: 0

user1480400
user1480400

Reputation:

Unless you are developing a PhoneGap plugin, you will be dealing with just HTML/JS/CSS files. If you developed Android Plugin, you have to re-implement the same functionality in Objective C. Otherwise, just copy over the files inside assets/www to www in XCode project folder and compile it.

Upvotes: 2

ShawnW.
ShawnW.

Reputation: 1852

I thought that the point of phonegap was that you wouldn't have to 'port' the application over, that it should run/compile/whatever on iOS and Android without a whole lot of judo to make it work.

My point is I don't think that's possible, you will have to re-write your java stuff in Objective C, or go back through the phonegap documentation to see what language and techniques you have to use to avoid having to port one to the other.

Upvotes: 0

Related Questions