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.
Related
I'm working on a progressive web app (PWA) that will also get embedded into an Android app with Apache Cordova. Will Web Push Notifications work for an Apache Cordovo Android app like native push notfications or do I need to use a plugin for that?
PWA will be just a SPA which will render on web-view and Cordova will provide the bridging between native and PWA.
Now the point, is Cordova support PWA?
In general, Cordova has little to do with PWAs. Yes, there is a Cordova browser platform . But that does not matter much, because very few plugins support it. You need to check the docs of each plugin you are using, to see if they support the browser platform.
As far as your requirement looks you can use use phonegap-plugin-push which also support browser platform.
Reference:
1. https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PLATFORM_SUPPORT.md
2. https://github.com/phonegap/phonegap-roadmap/issues/180
I would like to add an update to this question. As of 2021, Phonegap is no longer maintained and has been discontinued by Apache.
On their website
Adobe has discontinued PhoneGap Build and ended investment in PhoneGap
and Apache Cordova.
On August 2020 Apache wrote this article on their blog
In the context of these developments and declining PhoneGap usage,
Adobe is focusing on providing a platform that enables developers to
build, extend, customize and integrate with Adobe products. Today, we
are announcing the end of development for PhoneGap and PhoneGap Build
and the end of our investment in Apache Cordova. The PhoneGap Build
service will be discontinued on October 1, 2020.
If you are developing a PWA or Hybrid app, you are better off utilizing Ionic or BEST case scenario the Cordova Cli. Phonegap and any phonegap components and/or plugins should not be a solution of choice if you want to avoid smashing your head up against a wall further down the line.
New solutions (2021)
Ionic Framework with Push Notifications
https://ionicframework.com/docs/native/push/
Cordova Cli Push Plugin
https://github.com/havesource/cordova-plugin-push
I am using PhoneGap and Framework7 (UI) for my app. The app will be deployed on IOS, Android and Windows.
The app needs to play audio and also record audio. I will be using alot of javascript code for checking user answers and adding user scores.
My problem.
I looked at a few tutorials and examples. I am really confused.
I am using the latest version of PhoneGap. I am using PhoneGap Desktop to create a new project. I also downloaded the PhoneGap app to run it on my device. (All working)
My confusion.
I see in some tutorials it says this.
In order to create a PhoneGap project for Android, all you have to do
is run the command to add a platform to the project: $ phonegap platform add android
Do I need to add this too? I have created a build for the android version using PhoneGap Build (www.build.phonegap.com)
Do I have to change my app structure to accommidate both IOS and Android?
Is there a way to build for IOS on PhoneGap build without a certificate/key from Apple? I just want to test the app and see if its working on IOS. I am still in the beginning stage of development.
Thanks in advance
The PhoneGap Desktop / Developer app combination, while great, is not a perfect representation of how your app will behave when built and installed on its own. You will need to do further testing to ensure your app works as expected.
The templates usually come with all the core plugins installed. These will ask for far more permissions than your app actually needs. You'll need to remove these from config.xml at some point prior to production.
config.xml is the preferred mechanism now for indicating which platforms and plugins are required by your app. Any missing platform or plugin will be automatically installed by any of the build tools (CLI or PhoneGap Build). See the Cordova documentation and PhoneGap Build documentation for more information.
PhoneGap Build determines which platforms you want to build for by looking for <platform name="..."> tags in your config.xml file. If you have none, all platforms are built, but at some point you'll need to limit this to the platforms you intend to target.
Note: IF you have the CLI installed, you can add platforms and save them in your config.xml by using cordova platform add --save android.
The same applies to plugins. Note that the PhoneGap Developer app only supports core plugins and a few third-party plugins.
You do not usually need to change your project structure to support iOS and Android. You may need to handle quirks that are present on each OS, but you should be able to do so using the same code base.
You cannot build an app on PhoneGap Build for iOS without having the requisite certificate and provisioning profile from Apple.
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.
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?
Being a newbie to phonegap development I have question for which i have not been able to find the answer yet. I have developed an using Xcode and phonegap. I used the IOS simulator and my iphone as a test device. After getting the development certificate, I could install the app using Xcode on my phone to test the app. I also submitted the app to the app store via Xcode.
I obviously want to deploy my app on other platforms like the android and windows. I know I can submit the app to phonegap build and it returns me all the executable files for different platforms.
But, instead of developing the app for IOS, if I had developed the app for android, I assume that phonegap build will give me a .ipa file.
How can I submit the app developed for android using phonegap submitted to the apple store for distribution.
Thanks for your help in advance.
Great question. I think the heart of this question lies at the differences between PhoneGap and Cordova. Cordova is sometimes thought of as the Open Source version of PhoneGap, but in reality, Cordova is the Open Source core of PhoneGap.
What does this have to do with PhoneGap Build? I'm getting there. When Adobe wanted to Open Source PhoneGap, they wanted to keep the branding for a few value added features that they could monetize. The Apache foundation had them rebrand the open source version, which is now known as Cordova, and Adobe retained the rights to use PhoneGap for their value added features, one of which is PhoneGap build. The PhoneGap Build FAQ might be useful info.
But, instead of developing the app for IOS, if I had developed the app for android, I assume that phonegap build will give me a .ipa file.
Actually, no. When you're developing with XCode for iOS, XCode itself produces the .ipa based on the Cordova (PhoneGap) template project. If you were to build for Android for instance, you would produce a .apk, which is, more or less, the Android equivalent of a .ipa. If you were to develop for Windows phone, you would produce a .xap file. The one problem with you doing this yourself is that you would need to have a template project for each of the different ecosystems that you then set the configuration, and add your resources to the www folder (or equivalent). This could be tedious, and a little time consuming. To make this process a little easier for developers, in comes PhoneGap Build, designed to take care of this step for you. You give them your universal PhoneGap app, based on your HTML, CSS and JavaScript (and possibly a little money, depending on your price plan), and they return you the signed apps, ready to be submitted. Awesome!
So in reality, there is nothing in PhoneGap Build that you couldn't do yourself (given enough time and effort), but they just make it easier for you to focus on the important thing, solving your original problems, and not spending time dealing with builds.
So to answer your final question, you have two choices: Use PhoneGap build to have it generate (pretty much) everything you need for both Android and iOS (As well as others), or set up new Template Projects for each, and drop in your resources in the associated www folder, and build it yourself. Check out the PhoneGap Download and the projects for the different platforms.
If you have any questions, comment on this answer, and I'll try to update as needed.
Update 1
Yes, PhoneGap Build provides app-store ready builds (See second advantage).
Get app-store ready apps without the headache of maintaining native SDKs. We do the work for you in the cloud and your app will always be built with the most up-to-date SDK for the platform you are targeting.