Prezi

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in the manual

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Android 101 (Class 1)

Presentation originally developed for Girl Develop It Android class. These slides assume no prior knowledge with Object Oriented Programming (OOP) or Java.
by Corey Latislaw on 2 January 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Android 101 (Class 1)

math <3 for int weight = 25; Set of related objects. Object Oriented Java Basics Object Application Programming Interface (API) Describe a camera in terms of objects. Object oriented language Variables Array Android Foot Eye Beak Penguin Abilities? Attributes? Eye Foot Beak leftEye
rightEye
leftFoot
rightFoot
beak Penguin waddle()
swim()
eat(fish) has a Animal has a has a is a Defining a complex system in terms of objects. System Item or concept with
attributes and abilities. Code Compiler Program
(Executable) Waddle
Swim Inheritance Children inherit parent
state and functions. age
weight Activity! Eye piece Lens Shutter lens
eyePiece
shutter Camera takePhoto()
adjustLight()
adjustZoom() has a has a has a is a DSLR saveToSDCard()
changeLens() currentLens Hide attributes, but advertize abilities.
(information hiding) Good Practice Example:
Penguin is an Animal.
Animals have a height and weight, so a Penguin does too. Penguins can waddle, but not every Animal can. Eat(fish) Age Weight Hungry? if (penguin.isHungry())
{
penguin.eat("fish");
}
else
{
penguin.swim();
} a-z Begin with letter No reserved words camelCase4LongNames A-Z 0-9 underscore boolean short long float double char Primitive Type Value Types int Object String Control Flow Example: If the penguin is hungry, feed it fish. Otherwise, make it swim. if Test a condition while (penguin.isHungry())
{
penguin.eat("fish");
} Example: While the penguin is hungry, feed it fish (stop when it is full). while Loop for (int i = 1; i <= 7; i++)
{
penguin.eat(tires);
} Example: Feed the penguin 7 tires. Conditional loop IntelliJ = inheritance composition Compile once, run anywhere Operators relational + - * / % addition concatenation positive subtraction negative multiplication division remainder == != > equal to not equal greater than less than less than or equal >= <= < greater than or equal logic && || ! not and or assignment -- increment decrement ++ = assignment += modify & assign -= *= /= %= Activity! x += 2; int x = 4;
int y = 2;
boolean z = false; z = (x == 4);
z = (x <= y); x = 6 z = false z = true x = 2 * x + y; x = 10 Assignment Name Examples // Primitive & string
boolean isHungry = false;
float pi = 3.14159;
char q = 'q';
String teacherName = "Corey";

// Objects
Penguin babyTux = new Penguin();
Object object; String[] daysOfWeek = new String[7];
daysOfWeek[0] = "Sunday";
daysOfWeek[1] = "Monday";
daysOfWeek[2] = "Tuesday";
daysOfWeek[3] = "Wednesday";
daysOfWeek[4] = "Thursday";
daysOfWeek[5] = "Friday";
daysOfWeek[6] = "Saturday"; Global Local Class Method Objects in code Class Related statements ¶ public int square( int x )
{
int squared = x * x;
return squared;
} Return type Name Parameters Return statement Access modifier // End method body // Begin method body keyword name inheritance Method access modifier // End class body // Begin class body Scope public protected private Access Corey Latislaw Pint of strawberries
Sugar Ingredients Instructions Clean & chop strawberries Cover with sugar Put in fridge Activity! public Sauce makeSauce( Strawberries strawberries, Sugar sugar )
{
// Process strawberries
strawberries.clean();
strawberries.chop();

// Make sauce
sauce = strawberries.coverWithSugar();
sauce.refrigerate();

// Return sauce
return sauce;
} Turn a recipe
into a method. ingredients / input / parameters Recipe steps Finished product Notifications Widgets Multi-tasking Voice actions Source: android.com/about http://www.technesstivity.com/wp-content/uploads/2011/06/Androids_are_coming.jpg 2011 My Goal: Android Army Intro Who are you?
What are your passions?
What do you want to learn? Rules This is a safe space.
There are no stupid questions.
Learning is the objective.
Everyone finishes together. XfinityTV
Philly ETE
WXPN
HowAboutWe Goals Make your first Android app.
Leave with a desire to learn more. keyword Corey Leigh Latislaw CoreyLatislaw.com Lots of different devices
Written in Java
Can call APIs and other apps IDE - Integrated Development Environment -32,768
32,767 -9,223,372,036,854,775,808
9,223,372,036,854,775,807 -2,147,483,648
2,147,483,647 1.40129846432481707e-45 3.40282346638528860e+38 4.94065645841246544e-324d 1.79769313486231570e+308d Make sure the condition terminates! public class MathFunc
extends Funcs
{
int squared( int x )
{ return x * x; }
} github.com/colabug/Penguin-Java-Example Homework 1. Fork repository locally
2. Read HOMEWORK file
3. Complete exercises
4. Commit and push to github @corey_latislaw Android Android Alliance @androidphilly Corey Big words, easy concept! Code that someone else wrote
Use a particular format to "call" it waddle()
swim()
eat(item) authenticate(username, pass)
getToken() dev.twitter.com/docs/api http://coreylatislaw.com/android-101-class-1/
See the full transcript