FTC: Moving from Robot-C to Java
5/2/15
Jeanne Boyarsky
Programming Mentor FRC Team 694
slideshare.net/boyarsky
Twitter @j...
Pause for Commercial
My first book:
Choices for Coding
Step Tool Type of
programming
Comments
Crawl Point to Point
(download two
existing apps)
Configuration ...
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
en...
Installing Android Studio
Pre-reqs:
Java JDK 8 (or 7 if already have it)
Lots of RAM (2-4 GB)
Any Operating System 
ht...
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
...
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 point...
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!
Wha...
Questions
About Java:
– Friendly forums for those new (or not
new) to Java:
http://www.coderanch.com
For FTC specific qu...
References
Android Studio:
https://developer.android.com/sdk/index.htm
FTC Schematic:
http://modernroboticsinc.com/Conte...
Upcoming SlideShare
Loading in …5
×

FTC Robot C to Java

3,673 views

Published on

A high level overview of:
1) Android Studio
2) C/C++ to Java
3) Reading Java

The target audience is FIRST FTC students alraedy using Robot C

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,673
On SlideShare
0
From Embeds
0
Number of Embeds
23
Actions
Shares
0
Downloads
17
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

FTC Robot C to Java

  1. 1. 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
  2. 2. Pause for Commercial My first book:
  3. 3. 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
  4. 4. Java – the lay of the land Non-Android Java program stops here
  5. 5. 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
  6. 6. 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!
  7. 7. Setup Pre-reqs: Time Internet Admin rights Wizard guides you through setup/downloads runtime
  8. 8. Create Android project (even to play with Java)
  9. 9. Create Java library
  10. 10. Finish up
  11. 11. First class
  12. 12. Run it Run > Run FTC
  13. 13. 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.
  14. 14. Same in Java Lots Arrays If statements Math Calling a method (mostly) Comments
  15. 15. Big differences in Java Garbage collection! no malloc/free – unless calling C/C++ No pre-processor directives No pointers No operator overloading Platform independent
  16. 16. Android Studio - Views Default – Android view Project view – shows file system
  17. 17. Android Studio – Autocomplete Control + space
  18. 18. Reading: Parts of a class Imports Superclass Interface
  19. 19. Reading: C-like enough, right? Instance variable
  20. 20. Package (like a folder for grouping) Top level Class Nested class Comment Constant Reading: Complex Android Class
  21. 21. 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
  22. 22. 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?
  23. 23. 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

×