Android Studio Guide - Firstinspires

Transcription

FIRST GAME CHANGERSSM powered by Star Wars: Force for Change2020-2021 FIRST Tech ChallengeAndroid Studio Guide

2 FIRST Tech Challenge Android Studio ManualSponsor Thank YouThank you to our generous sponsors for your continued support of the FIRST Tech Challenge!Revision 1: 03.04.2021

FIRST Tech Challenge Android Studio ManualRevision12Date06/29/202003/04/2021 3Revision HistoryDescriptionInitial ReleaseUpdate to installing the FTC Apps without Google PlayContentsContents . 31.Introduction. 6What is FIRST Tech Challenge? . 6FIRST Core Values . 62.Gracious Professionalism . 63.Introduction to Android Studio . 74.The FTC Control System . 74.1.About the FIRST Tech Challenge . 74.2.Autonomous vs. Driver-Controlled . 84.3.Point-to-Point Control System . 84.4.REV Robotics Expansion Hub . 94.5.REV Robotics Control Hub . 104.6.What's an Op Mode? . 105.Required Materials . 116.Using Your Android Device. 177.6.1.Unlocking Your Screen . 176.2.Navigating in Android . 196.3.Displaying Available Apps on your Android Phone . 216.3.1.Android Marshmallow Users . 216.3.2.Android Nougat Users . 21Configuring Your Android Devices . 227.1.What Needs to Be Configured for My Control System? . 227.1.1.Control Hub Users . 227.1.2.Users with Two Android Smartphones . 237.2.Renaming Your Smartphones . 237.3.Installing the FTC Apps . 317.4.Placing Phones into Airplane Mode with Wi-Fi On . 397.5.Pairing the Driver Station to the Robot Controller . 417.5.1.Control Hub Users . 41Gracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

4 FIRST Tech Challenge Android Studio Manual7.5.2.8.Users with Two Android Smartphones . 53Connecting Devices to a Control or Expansion Hub . 548.1.Connecting 12V Power to the Hub. 548.2.Connecting a Motor to the Hub . 588.3.Connecting a Servo to the Hub . 598.4.Connecting a Color-Distance Sensor to the Hub . 618.5.Connecting a Touch Sensor to the Hub . 639.Configuring Your Hardware . 659.1.Before You Begin. . 659.2.Connecting an Android Smartphone to an Expansion Hub . 659.3.Getting the Control Hub Ready . 689.4.Creating a Configuration File Using the Driver Station . 689.5.Configuring a DC Motor . 749.6.Configuring a Servo . 789.7.Configuring a Color Distance Sensor. 829.8.Configuring a Digital Touch Sensor . 879.9.Saving the Configuration Information. 9010.Installing Android Studio . 9710.1.Android Developer Website . 9710.2.System Requirements . 9710.3.Java Development Kit . 9710.4.Downloading and Installing Android Studio . 9711.Disabling Android Studio Instant Run . 9911.1.Introduction . 9911.2.Locating Instant Run Settings . 9911.3.Additional Information . 10112.Downloading the Android Studio Project Folder . 10112.1.Downloading the Android Studio Project Folder . 10112.2.Extracting the Contents of the Archived Project File . 103Importing the FTC Project into Android Studio . 10613.Enabling Developer Options . 10814.Creating and Running an Op Mode (Android Studio) . 11014.1.TeamCode Module . 11014.2.Javadoc Reference Information . 11114.3.Enabling Auto Import . 11114.4.Sample Op Modes . 112Revision 1: 03.04.2021

FIRST Tech Challenge Android Studio Manual 514.5.Creating Your FIRST Op Mode . 11314.6.Examining the Structure of Your Op Mode . 11514.7.Building and Installing Your Op Mode . 11814.8.Running Your Op Mode . 12214.9.Modifying Your Op Mode to Control a Motor . 126Running Your Op Mode with a Gamepad Connected . 12815.Controlling a Servo (Android Studio) . 13115.1.What is a Servo Motor?. 13115.2.Modifying Your Op Mode to Control a Servo . 13116.Using Sensors (Android Studio) . 13416.1.Color-Distance Sensor . 13416.2.Touch Sensor . 13417.Appendix A – Resources. 136Game Forum Q&A . 136FIRST Tech Challenge Game Manuals . 136FIRST Headquarters Pre-Event Support . 136FIRST Websites . 136FIRST Tech Challenge Social Media . 136Feedback . 136Gracious Professionalism - “Doing your best work while treating others with respect and kindness - It’s what makes FIRST, first.”

6 FIRST Tech Challenge Android Studio Manual1. IntroductionWhat is FIRST Tech Challenge?FIRST Tech Challenge is a student-centered program that focuses on giving students a unique andstimulating experience. Each year, teams engage in a new game where they design, build, test, and programautonomous and driver operated robots that must perform a series of tasks. To learn more about FIRST TechChallenge and other FIRST Programs, visit www.firstinspires.org.FIRST Core ValuesWe express the FIRST philosophies of Gracious Professionalism and Coopertition through our CoreValues: Discovery: We explore new skills and ideas.Innovation: We use creativity and persistence to solve problems.Impact: We apply what we learn to improve our world.Inclusion: We respect each other and embrace our differences.Teamwork: We are stronger when we work together.Fun: We enjoy and celebrate what we do!2. Gracious Professionalism FIRST uses this term to describe our programs’ intent.Gracious Professionalism is a way of doing things that encourages high-quality work, emphasizes thevalue of others, and respects individuals and the community.Watch Dr. Woodie Fl

This tutorial uses Android Studio to help you get started programming your robot. Android Studio is an advanced integrated development environment for creating Android apps. This tool is the same tool that professional Android app developers use. Android Studio is only recommended for advanced users who have extensive Java programming experience . 4. The FTC Control System 4.1. About the FIRST .