How to build an Android app with Angular

Building an Android (or iPhone) app with Angular is super simple. In this guide, I will take from you Angular to App Store in 10 easy steps.

Angular Android

Prerequisites

 

Build an Android app with Angular

Install Cordova = Open a command prompt and type npm install -g cordova

Create a project = Navigate to the directory where you wish to create your project and type cordova create getting-started-app

Add a platform = Navigate to the project directory and add a platform by typing cordova platform add android

Run your app = From the command line, type cordova run android

Build your Angular app = Navigate to your project directory and type ng build --prod

Copy your Angular app to Cordova = Navigate to the dist folder and copy the contents of the build to the Cordova www folder e.g. angular/dist/getting-started/*.* to cordova/www/*.* (delete anything already in the www folder).

Configure the project = Open www/index.html in a text editor. Change <base href=“/”> to <base href=“./”>

Run the app = From the command line, type cordova run android

Sometimes the emulator does not start automatically. If this happens manually launch the emulator via Android Studio. The menu item is Tools, AVD Manager.

Sign your app = Before you can publish your app you will need to sign it. You can read more about that here.

Publish your app = To publish your app you will need a Google Play Developer Account. Sign up here.

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.