Git Product home page Git Product logo

android-app's Introduction

Cordova App Template

Using Cordova we can build native apps using any frontend web framework such as Angular. The final result is a Android .aab file or an iOS file that can be uploaded to the Google Play Store or Apple App Store.

Angular for the User Interface

npm run build

We can put any HTML, CSS, and JS into the Cordova project. So in your Angular build it is importaqnt we note the location of the output and the location of the input for Cordova.

This is why we need to do this in the Cordova build steps so we get recent files.

cp -r dist/cordovatest/* cordova-project/www/

Android (.aab)

npm run build:android

ng build && cp -r dist/cordovatest/* cordova-project/www/ && cd cordova-project && cordova build android --release

This .aab file can be directly uploaded to Google Play store. From what I remember we do not need to sign it ourselves, Google handles the signing of it.

Keystore

In our home directory we made a keystore

stefonalfaro@pop-os:~$ keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-key-alias

Convert .aab to .apk and sign

This is done if we do not upload to the Google Play Store. The Play Store requires the .aab whereas the phone needs an .apk and it needs to be signed. So this is how we can generate a signed .apk ourselves.

stefonalfaro@pop-os:~$ java -jar bundletool.jar build-apks --bundle=/home/stefonalfaro/Documents/CodeLearning/Angular/cordovatest/cordova-project/platforms/android/app/build/outputs/bundle/release/app-release.aab --output=/home/stefonalfaro/Documents/CodeLearning/Angular/cordovatest/cordova-project/platforms/android/app/build/outputs/bundle/release/app-release.apks --mode=universal --ks=my-release-key.jks --ks-key-alias=my-key-alias

CIDI Merge Master

How can we automatically deploy to Production (Apple App Store) from our CI/DI scripts when we merge a PR to Master?

iOS

npm run build:ios

ng build && cp -r dist/cordovatest/* cordova-project/www/ && cd cordova-project && cordova build ios --release

This will give error on Linux/Windows saying xcodebuild was not found. Please install version 11.0.0 or greater from App Store. This is why are going to use https://codemagic.io/ to build on a Mac. The documentation for CodeMagic says to add a codemagic.yaml to the project root.

CIDI Merge Master

How can we automatically deploy to Production (Google Play Store) from our CI/DI scripts when we merge a PR to Master?

How to Setup a New Project

npm install -g cordova
cordova create cordova-project
cd cordova-project
cordova platform add android
cd ..
ng build --prod
cd cordova-project
cordova build android --release

Sign the AAB File: If you don't already have a keystore, create one with this command:

keytool -genkey -v -keystore my-release-key.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias my-key-alias

Then, sign the AAB file using the jarsigner tool:

jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore my-release-key.keystore platforms/android/app/build/outputs/bundle/release/app-release.aab my-key-alias

android-app's People

Contributors

stefonalfaro avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.