-
Notifications
You must be signed in to change notification settings - Fork 3
Installation
This guide walks you through setting up the development environment for the RCOS Shuttle Tracker Android app, including Git, Android Studio, and Google Maps API configuration.
Download Android Studio here: https://developer.android.com/studio.
During setup:
- Click Next on the setup pages unless you want to change default settings
- Click Finish and allow the installation to complete (this may take some time)
If you are on Windows, install Windows Subsystem for Linux (WSL): https://docs.microsoft.com/en-us/windows/wsl/install
Open your Ubuntu / WSL terminal and run:
apt-get install git or if prompted, use: sudo apt-get install git
Next, sign in to https://www.github.com, or sign up if you do not have an account. Make sure to remember the username you give, this will be important for later.
Configure Git with your username and email:
git config --global user.name "your_username"
git config --global user.email "your_emailid"
These commands will link your username and email to your computer, so GitHub knows who authored your commits.
Run the following command in your terminal:
git clone https://github.com/wtg/Shuttle-Tracker-Android.git
The code will be downloaded into a folder named Shuttle-Tracker-Android.
- Open Android Studio
- Click Open and navigate to and select the Shuttle-Tracker-Android folder
Get your own custom google maps API key. Here's a guide that details how to get one for yourself: Here.
If you have trouble obtaining your debug SHA-1 this might help
Run this in a terminal (WSL users on Windows):
keytool -list -v \
-keystore /mnt/c/Users/<YOUR_WINDOWS_USERNAME>/.android/debug.keystore \
-alias androiddebugkey \
-storepass android \
-keypass android
Open the local.properties in your project level directory, and then add the following code.
MAPS_API_KEY=YOUR_API_KEY
- In Android Studio, open the Device Manager, click the + button, and select Create Virtual Device.
- Choose Pixel 5. When prompted to select a system image, choose API level 31 (Android S).
- Select the Pixel 5 emulator as your run configuration.
- Click Run.
After completing these steps, the virtual Android device should launch and Google Maps should load correctly. Once that's all done, congrats. You are now ready to start development for the RCOS Shuttle Tracker Android app.
If you complete steps 1 through 4 and you are receiving the build tools is corrupted issue, use this link to Stack Overflow to solve the problem and put yourself back on track because of an error on Google's part: Here.
If you have an error that looks like this,
This project is not compatible with higher versions of java. Do not click project update recommended popup, it will fix the problem but then no longer be compatible with other branches/main project.
If you have a higher version of JDK installed, manually set JAVA_HOME to be jdk-17(must be at least this).
Can use the following commands to install and set JAVA_HOME to jdk-17(run these in the Ubuntu Terminal):
sudo apt update
sudo apt install -y openjdk-17-jdk t
readlink -f $(which javac)
You will see something like this: /usr/lib/jvm/java-17-openjdk-amd64/bin/javac and java home should be: /usr/lib/jvm/java-17-openjdk-amd64
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH