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
Related
I'm working with a client who's considering migrating their existing MobileFirst Platform 7.1 hybrid app to the Cordova app type.
They are trying to understand if this app type would still give them access to MobileFirst APIs such as WL.App.sendActionToNative to easily bridge the native and JS layers. The list of supported and unsupported features doesn't mention those APIs; are they supported in Cordova-type apps?
Well...
In a Hybrid app one of the benefits of Worklight was that "we" own the native and web portion. You could create a Cordova plug-in (based on the tutorials) if you wanted, but with SendActionToNative - because we own both sides - helped here by "bridging" the two ends, "negating" the need for a Cordova plug-in. This feature is a "Cordova plug-in" in itself(!) internally.
In a "pure" Cordova apps we don't own both ends. Only the web end... The MFP SDK is now a Cordova plug-in.
Anyway, yes, you could enter the platform folder where the native code is and use those APIs and it should work, but in a Cordova world that does not make much sense - you're not supposed to touch any native code... you're supposed to use Cordova plug-ins in order to interactive with the native later...
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.
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.
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.
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.