FTC: Moving from Robot-C to Java
5/2/15
Jeanne Boyarsky
Programming Mentor FRC Team 694
slideshare.net/boyarsky
Twitter @jeanneboyarsky
Blog: http://www.selikoff.net
Moderator on Java forums at:
http://www.coderanch.com
Pause for Commercial
My first book:
Choices for Coding
Step Tool Type of
programming
Comments
Crawl Point to Point
(download two
existing apps)
Configuration Rookie
teams?
Prototyping?
Walk MIT App
Inventor
Blocks Like Scratch
Run Android Studio Text (most like
Robot-C)
Real
programmers
use
http://appinventor.mit.edu/explore
https://developer.android.com/sdk/index.html
Java – the lay of the land
Non-Android
Java
program
stops here
Major parts
JDK (Java
Development Kit)
IDE (integrated
development
environment)
Editor Emulator
javac
JRE (java
runtime
environment)
APIs
(libraries)
Git
(version
control)
java
Gradle (build)
Note: Github.com offers free hosting
Installing Android Studio
Pre-reqs:
Java JDK 8 (or 7 if already have it)
Lots of RAM (2-4 GB)
Any Operating System 
http://www.oracle.com/technetwork/java/javase/downloads/i
ndex.html
https://developer.android.com/sdk/index.html
The official IDE
for Android!
Setup
Pre-reqs:
Time
Internet
Admin rights
Wizard guides you through setup/downloads runtime
Create Android project
(even to play with Java)
Create Java library
Finish up
First class
Run it
Run > Run FTC
C/C++ vs Java - differences
For C/C++ Java
Constants Header file Interfaces or
static/final fields
Referencing
other code
#include import
Primitives bool, int, short, etc boolean, short, int,
long, float, double
Strings char[] or string String
These are not logical equivalents. Just in similar spaces.
Same in Java
Lots
Arrays
If statements
Math
Calling a method (mostly)
Comments
Big differences in Java
Garbage collection!
no malloc/free – unless calling C/C++
No pre-processor directives
No pointers
No operator overloading
Platform independent
Android Studio - Views
Default – Android view
Project view – shows file system
Android Studio – Autocomplete
Control + space
Reading: Parts of a class
Imports
Superclass Interface
Reading: C-like enough, right?
Instance
variable
Package (like a folder for grouping)
Top
level
Class
Nested
class
Comment
Constant
Reading: Complex Android Class
Java Version Q&A
Why doesn't Java know how to count? The
versions go 1.1, 1.2, 1.3, 1.4, 5, 6, 7, 8
Blame marketing!
What books are good for learning Java?
Head First Java
Thinking in Java (older versions free)
Java for Dummies
Deitel & Deitel
Core Java
Questions
About Java:
– Friendly forums for those new (or not
new) to Java:
http://www.coderanch.com
For FTC specific questions:
– http://www.chiefdelphi.com
– http://ftcforum.usfirst.org/forum.php
– https://www.reddit.com/r/FTC/
– Where else?
References
Android Studio:
https://developer.android.com/sdk/index.htm
FTC Schematic:
http://modernroboticsinc.com/Content/Images/
uploaded/Schematicx1000.jpg
FTC Kit: http://modernroboticsinc.com/first-ftc
FTC Controller: http://first.intelitek.com

FTC Robot C to Java