Quickstart¶
The main tech stack comprises of:
- Angular
- Ionic
- Capacitor
Additional Developer Prerequisites¶
- Install angular CLI -
npm i -g @angular/cli
- Install ionic CLI - -
npm i -g @ionic/cli
Building / Running app on Android¶
Setting up Building for Android (on Windows)¶
- Install Android Studio (https://developer.android.com/studio)
- Install Android SDK Tools (26.0.1 or greater), as illustrated here: https://capacitorjs.com/docs/android#getting-started
- Ensure that the active deployment is fully configured in accordance with the requirements detailed in Android app management.
- To populate the Android build files with the app ID, app name and version number (
content_tag_latest
) defined in the deployment config, runyarn workflow android configure
- Build the project locally and sync android files
yarn build npx cap sync android
- Open the project in Android Studio
npx cap open android
- From Android studio you can manage the app build, emulate and run processes, as illustrated here: https://capacitorjs.com/docs/android#running-your-app
Android studio should handle the process of downloading required tools, find below guidance for manual configuration.
Manual configuration steps - (Windows)¶
This will automatically install required
- First install JDK 8 and make sure environment variable JAVA_HOME points to the folder that looks like this
C:\Program Files\Java\jdk1.8.0_241
- Secondly install the Android SDK (which will be installed if you install Android Studio).
- Set the environment variable ANDROID_HOME to the location of your Android SDK install. This will probably look like
C:\Users\<USER_NAME>\AppData\Local\Android\Sdk
- Download Gradle extract it to a folder in your program files folder for example
C:\Gradle\gradle-6.3\
- Add the following to your PATH environment variable so we can execute java, gradle and android commands.
%JAVA_HOME%\bin
C:\Gradle\gradle-6.3\bin
%ANDROID_HOME%\emulator
%ANDROID_HOME%\tools
%ANDROID_HOME%\platform-tools
- Open Android studio, now open Tools > SDK Manager and install
Manual configuration steps - (Linux or MacOS)¶
If you want to setup building for Android on Linux or MacOS then you'll need to install
- JDK 8: https://www.oracle.com/java/technologies/javase-jdk8-downloads.html
- Gradle: https://gradle.org/install/
- Android Studio: https://developer.android.com/studio/index.html
Once you've installed those tools you'll also need to make sure you PATH and ANDROID_HOME environment variables are correct. More on this here: https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#os-x-and-linux
Running on an Android Emulator¶
- Open Android studio and follow the steps here https://developer.android.com/studio/run/managing-avds#createavd to create an Android emulator. When choosing a system image to create an emulator for do not choose a version of Android older than 5.0 Lollipop (API Level 21).
- In case you are having problems with running the AVD you might receive an error message saying something like - How to Enable Intel Virtualization Technology (vt-x) ……… you will need to get into your bios and enable virtualization if you are not sure what that is, then you can google it up for your computer model.
- Once you've created an emulator run directly from Android Studio
Running on a physical Android device (developing on Windows)¶
- Make sure you've followed all the setup steps in Setting up Building for Android Devices.
-
In order to run on a physical Android device you will need to download the adb driver for your device onto your Windows computer.
-
If you have a Google Nexus or Pixel device use this tutorial: https://developer.android.com/studio/run/win-usb
-
If you have an Android phone from any other manufacturer use this tutorial: https://developer.android.com/studio/run/oem-usb
-
Plug in your Android device and make sure from within the settings you've enabled USB debugging.
- Run in the command line
adb devices
to check that your device is connected via ADB. - Now to run the parenting app on your device, click the run button in Android Studio
Running on a physical Android device (Linux or MacOS)¶
- Make sure you've followed the previous steps for setting up JDK8, Gradle and Android Studio.
- If on Linux run sudo apt-get install adb
- Plug in your Android device and make sure from within the settings you've enabled USB debugging.
- Run in the command line
adb devices
to check that your device is connected via ADB. - Now to run the parenting app on your device, click the run button in Android Studio
I'm sure this wont cause problems later