I have a Sencha application which i use to create iOS and Android apps. I have tried cordova but dont really understand why people prefer phonegap over cordova.
Enlightenment needed
The main reason to prefer phonegap is if you want to use phonegap build.
Project built using phonegap cli generates a config.xml using a different shema to handle specific PG build extensions.
Other benefit of phonegap can be if you want to use the Phonegap developer app (it may have changed but at the begining at least, it was supported only by the phonegap cli).
And there are also people using phonegap because at the begining there was only phonegap (before phonegap was renamed cordova) and most people continue to use the name phonegap for all cordova/phonegap stuffs.
Related
I have an angular 7 project deployment which runs fine on apache. I like to
use it on android app. After some study, a server like cordova is necessary
for android platform. nativescript is also an option. I really like not to
have cordova bundled in android app. Is it true that I can not use angular 7
deployment directly on webview app? I have several app run on angularjs 1.x which
is working great.
any comment would be appreciated.
Cordova is NOT needed and you can easily use your Angular deployment inside the webview of
android/iOS app.
Cordova is not a server, but it provides the below
CLI to create and manage android/iOS projects and also generate the apk/ipa (app binary). So, with your angular depoyment, you can generate both iOS and android app with single CLI.
These created projects uses webview internally, so all your HTML resources are rendered inside webview.
Plugins interface to communicate with native modules. There are plugins available for automated codepush too.
Finally, if you can maintain your android/iOS app yourself, and all you want is just rendering your HTML app inside webview, you do not need Cordova.
I have been confused about the difference of building an apk using this commands:
ionic cordova build android
vs
cordova build android.
it seems that it has different output or file size when I look into debug apk on path
/platform/android/app/build/outputs/apk
Ionic ships with many built-in components, that in most cases gives a UX/UI closer to native components. This is the basic advantage of using ionic.
The fact is, Ionic is built on top of Cordova, so you cannot argue that
ionic runs better than Cordova itself. Ionic is like steroids that you
can give to your Cordova apps.
CLI
It is always best advised to use Ionic CLI commands over Cordova when in an ionic environment. This is to ensure that ionic properly packs all its components/files alongside with Cordova and your app logic.
Output Size
APK/IPA sizes vary depending on the amount of logic included, let alone the code from your specific framework. If a simple Cordova app is 4mb, then ionic would be 4mb + size of ionic components. Frameworks like Angular has complex engines like Ivy, that reduces the app build size, but those do not refactor anything related to Ionic or Cordova.
ionic cordova build android is Like running cordova build directly, but also builds web assets with configuration from ionic build and provides friendly checks.
Check out the documentation here
Cordova have own libraries so far and it is stable ionics also use them.
https://cordova.apache.org/docs/en/latest/ Apache Cordova is an
open-source mobile development framework. It allows you to use
standard web technologies - HTML5, CSS3, and JavaScript for
cross-platform development. Applications execute within wrappers
targeted to each platform, and rely on standards-compliant API
bindings to access each device's capabilities such as sensors, data,
network status, etc.
ionic also using that libraries for there frameworks and developments so in that case
best approach is why ionic use Cordova
Ionic, Cordova and PhoneGap are hybrid apps. ... They are written in
JavaScript but are rendered using native components, which means that
the user experience will generally be closer to other native apps,
because they will conform to the standards imposed by the operating
system
https://www.netguru.com/blog/why-you-should-migrate-your-app-from-ionic-cordova-or-phonegap-to-react-native
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.
We are currently considering building an app for iOS and Android using Angular Material.
Having worked with Ionic before, I really like the out-of-the-box dev tools it provides (easy Crosswalk integration, preview server, etc). Is it possible to still make use of those to build and deploy the project (as if we were working with a standard Ionic project), without actually including any Ionic JS or CSS components in the code itself?
Ionic ties in to Crosswalk through Cordova.
The Ionic CLI offers a lot of tools to make working with Cordova easier so it is worth keeping Ionic around even if you don't want the templates.
You can easily get the benefits of Ionic like Cordova and Livereload without the Ionic JS and CSS by installing an Ionic app like normal and just removing the CSS and JS requirements from your HTML.
You can then use Bootstrap, Foundation, or nothing at all.
Ionic as a CLI and framework offers a lot of power, but ultimately it just creates a static web app with plain old HTML, CSS, and JS. There's nothing magical about it.
Normally, we build native Android applications via Java.
Now, we also have Phonegap which can be used to build apps.
However, can we combine both of them so that some functions which cannot be called using html, css and javascript can be used through PhoneGap.
Yeah you can do that by using or writing your own Phonegap Plugin.
Check the documentation for Phonegap Plugins.
http://wiki.phonegap.com/w/page/36752779/PhoneGap%20Plugins
Yes you can do it by creating a plugin for phonegap. By communicating with your plugin you will be able to run your Java code.
A good tutorial on how to build a plugin for phonegap/android can be found here:
http://phpmyweb.net/2011/09/14/creating-a-plugin-for-phonegap-1-0-android/