1 of 11

Programming Environment Setup for Android Studio

TEAM 13380

2 of 11

Android Studio

  • Android Studio is an integrated development Environment (IDE) for writing code in a collaborative environment
  • Some advantages of Android Studio as compared to other IDEs include
    • Its ability to debug in real-time
    • The ease of integrating libraries such as OpenCV or DogeCV
  • Android Studio works especially well with GitHub, as it allows multiple people to collaborate effectively

2

3 of 11

GitHub

  • GitHub is a Git repository hosting service that offers distributed version control and source code management
  • When integrated with Android Studio, it allows people to share their code, obtain other collaborators’ code, and access different iterations of the same code
    • This is known as “Version Control”
  • You can think of it as a collaborative “Google Drive” that can store all of your team’s code but also gives individuals the flexibility to work on specific programs

3

4 of 11

Installing Android Studio

  • Search up “Download Android Studio” and click on the link
    • It looks like this: “https://developer.android.com/studio
  • Here is a video showing the installation process: https://www.youtube.com/watch?v=hP0u-ib_Tm8

4

5 of 11

Configuring GitHub

  • Click on this link: “https://github.com/” and make an account there
  • Open up Android Studio and select
    • “File” >> “Settings” >> “Version Control”
  • Click on “Git” and select “Test” (to the right of “Path to Git executable”)
  • Then click on “GitHub” and then on “Create API Token” and enter your GitHub account details there 
  • Select “Apply” and then “OK”
  • This way you can access GitHub directly within Android Studio

5

6 of 11

Creating Your Team Repository

  • Create a team account on GitHub
  • In order to create your team repository, fork the most current version of the FTC SDK using your team account The most current version of the SDK can be found at: https://github.com/ftctechnh/ftc_app.git
    • You can select “fork” in the top right hand corner
  • This will allow you to create a repository for your team which is built off of the FTC SDK repository, allowing you to access those libraries

6

Student 1’s copy

Student 2’s copy

Student 3’s copy

Student 4’s copy

Student 5’s copy

7 of 11

Getting Your Team on the Repository

  • In order for team members to access the repository, they need to create a GitHub account and request access from the repository admin (the person that created the team repository)
  • After the admin grants access, team members have to follow the following steps:
    • Go to the homepage of Android Studio (the one that shows up when you first open it up)
    • Click on “Check Out Project From Version Control”
    • Enter your team’s Git Repository URL  
    • Then click “Test” and “Clone”
  • After successfully cloning the repository, team members can start contributing to the team repository

7

8 of 11

Creating a New File

  • Go to the folder where you want to add a file
  • Right click on the folder
  • Select “File” >> “new” >> “Java Class” >> Give it a name >> “OK”

8

9 of 11

Committing & Pushing Files

  • Committing
    • Press the check mark at the top right or go to VCS and press “Commit”
    • Enter a commit message and press “Commit”
  • Pushing
    • Instead of pressing “Commit,” click on the arrow near the commit button
    • Click “Commit and Push”
    • Select branch to push onto and press “Push”

9

10 of 11

Transferring Programs onto the Phones

  • Connect your Robot Controller phone (The phone that connects to the robot) to the computer you are working on using a USB
  • Build your program
  • Press the play button in the top right of Android Studio to download your program onto the phone
  • Wait for the phone to complete installation (A message will appear that says “Installed successfully in x seconds”)

10

11 of 11

Credits

  • This lesson was written by Ansh Kharbanda for FTCTutorials.com
  • You can contact the author at anshkhab@gmail.com

  • More lessons for FIRST Tech Challenge are available at www.FTCtutorials.com

Copyright 2020 FTCTutorials.com (Last edit 4/1/2020)