I have created an ios app using Xcode .Now I have to make it run on android also.So I downloaded phonegap 2.0 and create an xcode project using commandLine(./create ~/Desktop/newfolder com.companyname.projectname projectname).After that I added all the required classes and storyboard file of allready created ios project to this new one(created by using Phonegap utilities).
And now I can run this project.What I want to know is ,
Is this the correct way to make my ios app cross platform?
Is there any rule that only app created using CSS html5 and
javascript can be made crossplatform using Phonegap?
If my steps are wrong do I need to create the same project using CSS html5 and javascript again for making it cross platform.
You can't achieve such functionality using PhoneGap, here is the wikipage for PhoneGap
It says that it enables software programmers to build applications for mobile devices using JavaScript, HTML5, and CSS.
PhoneGap has different builds for different architectures, so once you've written your entire app using HTML5, CSS and JavaScript you can make build for every different platform available.
If you want to port iOS project into android it is not possible but if you want to port a HTML5 application you can do it using PhoneGap.
Create a PhoneGap project for android using command-line interface. Have a look at the Cordova Command-Line Interface.
Add the CSS, Javascript, HTML, image files inside respective folders. Also, add plugins required for the application using the command-line interface.
Hope it helps you.
First off the bat, if you're looking to port an existing Objective-C based iOS project then it is not possible to do so with PhoneGap.
PhoneGap or Apache Cordova as it is known now is not the only framework that can be used to write cross platform apps. I personally think it is one of the more well supported ones (being an open platform) and yes it is based on familiar web technologies i.e. HTML + CSS + Javascript and you are limited to using only this combination but then web frameworks are good enough for most development requirements these days. This is a good place to start off with Cordova development.
Cordova 3.x.x onward has matured well as a framework and post creation of a project one can add platforms using the command line interface (CLI). This is the common structure of a Cordova project :
/hooks /merges /platforms /plugins /www config.xml
The /www folder contains the web app that you're developing, typically :
/img /css /js index.html
The /platforms folder contains the projects for the various platforms that you've requested, typically :
/android /ios
It is these folders that contain the projects that need to be imported by the IDE that you're using. Say, for Android, import the contents of the android folder as an Existing Android Code Into WorkSpace and build it normally as an Android project. That is all.
Nonetheless, it has many limitations like the lack of support for in app billing, 3D graphics etc. I would like to suggest that you consider making native apps for all platforms you intend to support.
Related
I am newbie in mobile development and I try to run instances locally.
I try to understand how native frameworks work.
I found phonegap as a native framework. If I go to their site in order to download it I can download the latest version.
However also I found the apache cordova which is the same with phonegap?
What are the difference and which one I can use?
I doubt your inferences.
Phonegap is a framework that allows you to code mobile apps using languages commonly know for web development (HTML, CSS, JS, Jquery etc).
Apache Cordova is the engine that renders this source code to app format application file with file extensions that runs for Andriod or iOS or other platforms.
So you can have one source code and generate apps for every platform.
You need both Phonegap and Apache Cordova for this.
I have just finished an app in Eclipse using Cordova 2.9.0.
The app is JavaScript / HTML / CSS based.
Can anyone recommend software / a forum which had good tutorials on converting apps from Android to IOS?
Phonegap gives you the possibility to write once and use it for different platform Android, IOS ...
Create a progect with phonegap/cordova and add 2 platforms Android and IOS. Develop your app in root www directory. To specify different style, .js, html simply use directory merge.
Let say you need a different css for Android and IOS. In directory merge you have to have:
/merge/android/mycss.css and for IOS you have: /merge/ios/mycss.css
Look into Command-line Api of Cordova, search for "Using merges to Customize Each Platform". Here is the link
I would like to use PhoneGap - Cordova for developing HTML5 + javascript application that will display sensor data on both win8 and android.
I have a basic question which I didn't understand from my research in the web.
what is the structure of such application? I mean, how to build this cross platform application in one project only?
what I see in phone gap - getting started guide http://docs.phonegap.com/en/2.5.0/guide_getting-started_index.md.html#Getting%20Started%20Guides
and many other websites, is that the working mode is to open a project, for example in VS2012, for OS specific. but I want to use this project for win8 and android!
I'll appreciate any help, especially if you have code samples for it and maybe some useful tools\templates to open this project.
note: I'm new to HTML5-javascript.
gin,
the structure is you would be coding using jQuery,java script,CSS,resources and your basic HTML.
The HTML API and the CORDOVA's java script will integrate with the native plugins of Phonegap.
We can create our own plugin's,we have a format for it there in the same website.
You need to create different projects for each platform if you decide to build the app locally. For example, you need to create an Xcode project in a Mac machine to develop an iOS app. If you are ok to do cloud build, you can check out http://build.phonegap.com where you just need to upload your zipped html/js and css files and it will give u ready to run apps for iOS, Android, Windows mobile, BB etc...
just wanted to clear a confusion concerning phonegap,
My area of interest is mainly Android and Iphone. What I really understand about phonegap is that the phonegap app is platform independant when no native libs are ysed and thus run both on iphone and android. Thus if i build an android app on eclipse using phonegap without using any native libs, will it run on iphone as well??
Nope, this is not exactly the case.
Phonegap enables you to write cross-platform code (HTML, JS, CSS), but when it comes to building, you have to compile this code to a specific environment for each OS. For example you can build the Android version using eclipse, and the iOS version using Xcode.
Hope this helps!
No, you will still need to build for iPhone as well.
You can use the same source code for all systems.
I have been investigating Phonegap as a method of deploying an app to both Android and iOS. However, it seems like depending on what device you are programming for, there is a different set of instructions.
How do I set up something where the 'project' for both Xcode and ant are in separate directories but they both point to the same set of common assets? And how do I version control this...what should I .hgignore and what is necessary to keep around?
We generally have a www folder with the html, js, css etc for your app and a folder next to it that contains the xcode project and android project then write a simple script to copy the www code into the platform specific projects ... some of this is made more simple with tools like github.com/brianleroux/cordova
You could also check out build.phonegap.com