Create Simple Android App using Ionic + Angular and Cordova

We are going to learn how to create simple Android App using Ionic + Angular and Cordova.

Ionic Installation

Install Ionic CLI globally using below command.

doss@localhost sample-app]$ sudo npm install -g @ionic/cli

Create new ionic app

doss@localhost apps]$ ionic start sample-app

Framework: Choose the Angular in the framework selection using up and down keys.

Starter template: Choose the Starter template using up and down keys.(e.g: tabs, sidemenu, blank..,)

Integrate your new app with Capacitor to target native iOS and Android? Enter N option (i.e No) . Here we are going to use cordova for creating native builds for iOS and Android.

Test your first ionic app

Get inside to your new project then serve the app.

doss@localhost apps]$ cd sample-app
doss@localhost sample-app]$ ionic serve

Install Cordova to the project

If you are creating first ionic project, install cordova globally. To know more about Cordova read this information.

doss@localhost sample-app]$ sudo npm i -g cordova

Then run the following command to add android platform with project.

doss@localhost sample-app]$ ionic cordova platform add android
[WARN] About to integrate your app with Cordova.
       
       We now recommend ⚡️ Capacitor⚡️  (https://ion.link/capacitor) as the official native runtime for Ionic. To
       learn about the differences between Capacitor and Cordova, see these docs[1]. For a getting started guide, see
       these docs[2].
       
       [1]: https://ion.link/capacitor-differences-with-cordova-docs
       [2]: https://ion.link/capacitor-using-with-ionic-docs
       
? Are you sure you want to continue? Yes

To Create Prod build for Android/iOS

doss@localhost sample-app]$ ionic cordova build android --prod --release

What platform would you like to run (android, ios): Enter the platform name as “android”

Now the PROD build is created and available in the path:
/platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk

This app-release-unsigned.apk has to be signed. Then only it will be ready to upload in Play Store.

To Run Android App directly in mobile(debug mode).

If you have connected your android mobile with system, the following commands will install the app directly to your mobile.

Note:
Developer options -> USB debugging must be enabled in mobile.
If needed do “Revoke USB debugging authorizations” which will revoke all previous authorizations

doss@localhost sample-app]$ ionic cordova run --livereload --external

We can also start the app with in Android Emulator using the above command. For that emulator must be already installed in your system.

Now we have successfully created Android App using ionic+angular+Cordova.

Updated: July 26, 2020 — 4:46 pm

6 Comments

Add a Comment
  1. Do you have a spam issue on this site; I also am a blogger, and I was wanting to know your situation; many of us have created some nice procedures and we are looking to trade methods with others, why not shoot me an email if interested.| Dory Zacharias Karine

  2. I truly appreciate this post. Really thank you! Great. Karlotte Ruddie Wiltsey

  3. Incredible points. Solid arguments. Keep up the great spirit. Reba Gery Dorwin Morena Frederich Aurelius

  4. Of course, what a great site and informative posts, I surely will bookmark your blog. Have an awsome day! Carin Thorvald Willey

  5. travels hotels discounts travel cheap hotel discount deals Wylma Kele Berny

  6. My relatives every time say that I am killing my time here at net, except I know I am getting know-how daily by reading such good posts.| Betteann Kele Teryn

Leave a Reply