Skip to content

Latest commit

History

History
138 lines (93 loc) 路 2.35 KB

android.md

File metadata and controls

138 lines (93 loc) 路 2.35 KB

Installation

  • Getting Node and NPM
  • Install Ionic and cordova
npm install -g ionic cordova
  • Clone the repository
git clone https://github.com/CASES-LU/TACOS.git
  • Go to the folder
cd TACOS/
  • Launch the serve
ionic serve

Generate Android SDK

Requirements

  • Install Java JDK8 (Cordova is not compatible with the latest version of Java. You must install JDK8 to build Android apps with Cordova)
sudo apt install openjdk-8-jdk

Install Gradle

wget https://services.gradle.org/distributions/gradle-5.4.1-bin.zip -P /tmp

sudo unzip -d /opt/gradle /tmp/gradle-*.zip

Install Android SDK

wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -P /tmp

unzip -d ~/android-sdk-tools /tmp/sdk-tools-linux-4333796.zip

Create repositories.cfg File

touch ~/.android/repositories.cfg

Set environment variables

In ~/.bashrc, ~/.bash_profile, or similar shell startup scripts, make the following modifications:

  1. Set the ANDROID_SDK_ROOT environment variable. This path should be the Android SDK Location used in the previous section.
export ANDROID_SDK_ROOT=~/android-sdk-tools
  1. Add the Android SDK command-line directories to PATH. Each directory corresponds to the category of command-line tool.
# avdmanager, sdkmanager
export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin

# adb, logcat
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools

# emulator
export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
  1. Include gradle into your path
# gradle
export PATH=$PATH:/opt/gradle/gradle-5.4.1/bin

Install SDK build tools

sdkmanager "build-tools;28.0.3"

Update Android Packages

sdkmanager --update

Generation sdk

ionic cordova build android

To emulate android Phone

Doesn't in guest VM

Install same requirements for the generation a sdk

Install android image

sdkmanager "system-images;android-28;google_apis;x86_64"

Create device (AVD)

avdmanager create avd --force --name AndroidPhone --abi google_apis/x86_64 --package 'system-images;android-28;google_apis;x86_64'

run emulator

ionic cordova emulate android

Extract translations

npm run extract

Generate a production ready APK

./build.sh