Mervzs
Mervzs

Reputation: 1154

Difference of Ionic Cordova vs Cordova commands

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

Upvotes: 4

Views: 1200

Answers (3)

Nidhin Joseph
Nidhin Joseph

Reputation: 10237

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.

enter image description here

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.

Upvotes: 2

Chanaka Weerasinghe
Chanaka Weerasinghe

Reputation: 5742

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

Upvotes: 1

Renz
Renz

Reputation: 51

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

Upvotes: 1

Related Questions