What is the Difference between Apache Cordova and PhoneGap? - android

Hi I need to develop a simple application which is hybrid which runs in kitkat version of android. Since it is possible with PhoneGap 3.3 I have been trying to install it.
But I am really confused a lot with the installation procedure.
First I installed nodejs in my windows 7 32 bit system.
Then I ran the commands from the phonegap website. This is the link http://phonegap.com/install/
I was able to create a project.
But I am facing an error and not able to start the emulator.(I set the environmental variable. )
Then I have gone through couple of ohter websites where they said to run the following commands.
C:> npm install -g cordova
And if I run any further command beyond that it is asking me to install Apache ANT.
But many folks said me that both phonegap and cordova are same.
So I am a little confused since I have to ask my superiors for the download and installation of software in my office PC.
Please suggest me any website that gives me the procedure to work on these.

Phonegap and cordova uses almost the same repository,but they are not the same.Phonegap is build on top of cordova.
Cordova's releases a version first and phonegap usually follows.
The main difference between the both is that phonegap allows you to build your app online
https://build.phonegap.com/
Both have very different documentation
Here's a link to cordova http://cordova.apache.org/docs/en/3.0.0/guide_cli_index.md.html
And link to phonegap http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html
If you notice the links in the phonegap plugin in the documentary,you will notice phonegap uses cordova's plugin
Phonegap constantly plays catch up with cordova.I am a little biased towards cordova.I suggest you decide which is better for you

PhoneGap is a distribution of Apache Cordova. You can think of Apache Cordova as the engine that powers PhoneGap, similar to how WebKit is the engine that powers Chrome or Safari.
For more details you can read these blogs
PhoneGap, Cordova, and what’s in a name?
And this question on stackoverflow
Is there a difference between PhoneGap and Cordova commands?

Related

How to view result of phonegap in different platform(ios,android,windows)

I have created android project in eclipse, added cordova.js and cordova-2.9.0.jar file and created index.html to develop mobile application. On running this app, it by default runs in android emulator.
How can i see output of other platforms like ios,windows??
Lets work through your questions which is not even very detailed.
First of all, update your cordova. 2.9.0 is an old version. To do so just run
Mac:
sudo npm update -g cordova
Windows: (run cmd as administrator)
npm update -g cordova
After you did that, i would recommend you to read the very detailed documentation of cordova which can be found over here: Cordova Documentation.
Finished with that? Good, then you should know now, that there is now way to deploy an iOS App from your Windows Computer to your iPad or iPhone. This is only possible on a mac. Because the applications are just "rendered Websites" you can open up the index.html files inside your browser.
cue browser... there is a platform, which is called browser. This is a much better than the normal browsers. You will find a documentation for that over here: Browser Documentation and Information. It can be installed via
cordova platform add browser

How to combine Cordova, Crosswalk and Ionic framework

I'm trying to create a mobile application which combine the above projects and I'm not sure how should I do it.
Here are 2 options which I found:
Use https://github.com/MobileChromeApps/mobile-chrome-apps - My problem with it is that it seems that it's not production ready. (I was told that it is but I can't find any support for that).
Create a new ionic project, then add Cordova to it followed by empting the platforms/android/CordovaLib/ folder and moving into it files from Crosswalk (as explained at https://www.thepolyglotdeveloper.com/2014/10/use-crosswalk-ionic-framework-android-apps/) - This solution is quite simple but seems a little hackish for me...
Which option should I use? are there any other options?
Cheers,
---- Update ----
Ionic have incorporated the ability to combine Crosswalk in their own CLI, check it out at http://ionicframework.com/blog/crosswalk-comes-to-ionic/
Regarding Crosswalk
Crosswalk support is something that we hope will be available to vanilla cordova by default before the end of the year. You can start experimenting with this today by following the work on the cordova-android 4.0 development branch. It should be possible to add this platform (and the required plugins) directly to a new ionic project.
Chrome Apps for Mobile are cordova-cli compatible and do indeed already bundle Crosswalk by default. The primary difference with vanilla cordova is that applications must follow the Chrome Packaged App structure (have a manifest and background script), but gain the benefit of running on Desktop Chrome. See longer answer here. (I wouldn't read too much into the developer preview label.. we just like calling everything beta ;)
The current crosswalk-project.org provided cordova workflow does not use a cordova multi-platform application structure. It uses the cordova-android native app template directly. This means you will not be able to use the cordova cli, nor downstreams like cca or ionic. You will also obviously not be able to add other platforms, will have a tougher time upgrading, and managing plugins is a bit more complicated (you have to use the plugman tool directly).
There is currently no option for developing using cordova+crosswalk that is not without some tradeoff.
Regarding compatibility between Cordova, Ionic, Chrome Apps for Mobile (etc) projects
Most cordova downstream projects are "mostly" cli compatible. E.g. The cca cli (used by Chrome Apps for Mobile) supports commands like create, plugin add and platform add -- so it will work to install ionic plugins. Vice versa is also true, Chrome Api's for Mobile are developed as cordova plugins which can be added to an Ionic or cordova project using their respective cli's.
Most downstreams also use the same project directory structure (plugins/, platforms/, www/, hooks/, etc), so you can usually mix usage of the various cli's within one project to some degree.
That said, the reason cca needed a custom cli is because we do a few non standard modifications to your cordova project that aren't directly supported by vanilla cordova (yet). Ionic does the same.
I've suggested at various cordova meetups that downstream projects like Ionic, PhoneGap, and CCA, should play better together -- so your question is right on the money. We are mostly-compatible but finding out the differences is currently left as an exercise to the developer.
Using XDK HTML5 Cross platform Development IDE is probably the best way of integrating Crosswalk, Cordova and Ionic. It has built in support for Crosswalk. I have recently used it and its totally awesome. It will make our work a lot easier.
From Crosswalk site:
If you prefer to use a graphical integrated development environment (IDE), the free Intel XDK provides an alternative way to package applications for Crosswalk Android. See the Intel XDK website for more details.
This guy on youtube produced a nice, straight-forward tutorial that worked for me: https://www.youtube.com/watch?v=0I1OjJLVLMo
The results are fantastic, worth the struggle to get it working.
The guy says CrossWalk makes a big difference on anything running less than Android 4.4 (when Chromium was added).
Good luck.

Connecting AngularJS to Phonegap/Cordova

I am a beginner in developing with phonegap. For about 12 hours I have been trying to connect an AngularJS application with phonegap, in order to develope a mobile app for android. Unfrotunately, AngularJS does not seem to work for me. This is a link to my github repository, where I have pushed all the code from the www folder of the phonegap project. Basically I have everything linked to my index.html file, routes and controllers seem to look ok. I have done several angular.js applications before, but always with node.js, so this thing is really new for me. Sorry for posting the whole project, but I have been working on this long enough to have absolutely no idea where the problem is. I really tried everything I could...
Angularjs is definitely the best framework which gives us the facility to develop client application using great MVC framework.
Here is some links i have referred while i was developing phonegap app using angularjs first time.
divgirl 2013
divgirl 2014
coenraets 2013
coenraets 2014
These are the best for reference if you are talking about phonegap & angularjs
I was looking for the same thing a few days ago and I found this grunt project:
https://github.com/dsimard/grunt-angular-phonegap
I am assuming you have:
installed phonegap, generator-angular, grunt
made a phonegap project
added angular in your project by doing 'yo angular'
did a 'cordova platform add android'
Here is what you need to do next:
npm install grunt-angular-phonegap --save-dev
npm install (both 1. and 2. should be done once inside project directory)
grunt phonegap:check
(it checks if it can build in your system.
checkAdb will probably fail if you are using windows but you don't have to worry about that)
grunt phonegap:build
P.S.the regular command is grunt phonegap:command[:platform] but by default it does android.
That's it.
Thanks to https://github.com/dsimard for the awesome tool.

Do you need to install both cordova and phonegap?

I am trying to get started with phonegap/cordova for developing mobile apps.
Still a lil confused by the getting started part of the website
http://docs.phonegap.com/
In one place,CLI installation instructions, they say to install cordova.
IN another place,Phonegap installation instructions, they say to install phonegap.
What's going on here? Do we need both? What is the difference in roles of each one?
PhoneGap is a distribution of Apache Cordova. You can think of Apache Cordova as the engine that powers PhoneGap, similar to how WebKit is the engine that powers Chrome or Safari. (Browser geeks, please allow me the affordance of this analogy and I’ll buy you a beer later.)
Over time, the PhoneGap distribution may contain additional tools that tie into other Adobe services, which would not be appropriate for an Apache project. For example, PhoneGap Build and Adobe Shadow together make a whole lot of strategic sense. PhoneGap will always remain free, open source software and will always be a free distribution of Apache Cordova.
Currently, the only difference is in the name of the download package and will remain so for some time.
more
The PhoneGap CLI is built on top of the Cordova CLI. It has all of the functionality that the Cordova CLI has. The main difference is that the PhoneGap CLI has PhoneGap Build integration. So if you don’t have the native SDK installed, you can delegate compilation to the PhoneGap Build cloud service and get app-store ready mobile apps. Both tools are completely interoperable.
No, you don't. PhoneGap should include all of the commands that Cordova provides. It provides a cloud-based build feature, which Cordova does not.
The documentation on phonegap.com would benefit from clarifying its use of 'cordova' vs. 'phonegap'. Right now, it is too easy for new developers to get confused over which commands are relevant.

Phonegap build - development environment - Using the WinPhone environment to build android apps with build service

Say I'm a windows dev, familiar with Visual Studio and with a need of developing an Andriod app. I looked at both the andriod and wp7 getting started guides, but found the windows phone version http://phonegap.com/start/#wp guide much simpler than the Android version (of course, as a windows dev I have already everything installed).
Then comes my question:
Could I develop my app using the Windows Phone environment, and then use the PhoneGap Build services to get the Android version build?
In case, what should I upload to the build service?
Sorry if I got this all wrong, and thanks for any help!
Larsi
The whole idea of phonegap is to develop a multi platform app writing the code once.
So the answer is yes, you should be able to build the app for wp, and then re-use your code for all the other platforms, only if you onlyuse the phonegap API and do all your programming in JS, HTML and CSS.
About what you should upload, I haven't doned it myself, but I think that It would have to be all the JS, HTML and CSS from your app. In android all is located on a folder called "assets".
Good Luck!

Categories

Resources