Skip to content

Installation

Michonster edited this page Feb 9, 2022 · 6 revisions

Setup

Installation

  1. Download Android Studio Here. This is where we write the code. Click next on the setup page unless you would like to change the default settings. Once the setup wizard page opens, click Next twice, then make sure the UI theme is darcula and click next a third time and click finish. This may take a while to install completely.

  2. Set up WSL Here.

  3. install git.
    a. first run this line in ubuntu.
    apt-get install git Ubuntu might tell you to use sudo apt-get install git instead.
    Next, sign in to 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.

    b. go back to the terminal and run this command, but replace "your_username" with your own name (keep the quotation marks):
    git config –global user.name "your_username"
    and this command, replacing "your_emailid" with your own email address (keep the quotation marks):
    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.

  4. clone the shuttle-tracker-android repository. Run the command
    git clone https://github.com/wtg/Shuttle-Tracker-Android.git The code should be found in the folder titled Shuttle-Tracker-Android.

  5. Open android studio again, click open and navigate to the shuttle tracker project.

  6. Once the shuttle tracker project has been cloned, and you have access to commits, create a new folder in the ShuttleTrackerAndroid/app/src directory, named debug. In the ShuttleTrackerAndroid/app/src/debug directory, create a folder named res. And in the ShuttleTrackerAndroid/app/src/debug/res directory, create a folder called values. Now you should have access to the ShuttleTrackerAndroid/app/src/debug/res/values directory, which you can use to run your own API.

  7. (Potentially Optional) If you complete steps 1 through 6 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.

  8. In order to set up the virtual android phone, you will need to complete these steps:
    a. First create a file called google_maps_api.xml at ShuttleTrackerAndroid/app/src/debug/res/values, copy-paste this text in the section of the code that tells you to insert it into, and make sure to generate your API key and put it in.

    <resources>
        <!--
        TODO: Before you run your application, you need a Google Maps API key.
    
        Alternatively, follow the directions here:
        https://developers.google.com/maps/documentation/android/start#get-key
    
        Once you have your key (it starts with "AIza"), replace the "google_maps_key"
        string in this file.
        -->
        <string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">INSERT_KEY_HERE</string>
    </resources> 

    b. Get your own custom google maps API key. Here's a guide that details how to get one for yourself: Here

    c. Once you have received your custom API key, you should paste the API in the labeled section of the code. With that, you can move on to the final step of running the virtual android phone.

    d. Finally, on Android Studio, install the Pixel 5 API version 31 (Also known as Android S) by clicking the top right of your screen and using the debug configurations to set it to that API version. After following all these steps, you will be able to run the virtual Android and see the differences in your code contributions.

Once that's all done, congrats. You are now ready to start development for the RCOS Shuttle Tracker Android app.

Clone this wiki locally