SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
EESTEC Android
        Workshops
101 - Introduction to OOP, Java and Android
What we’ll cover today

 EESTEC, Android, it’s APP to you!

 Introduction to OOP

 Introduction to Java

 Setting up the Android Environment

 Running your first App
Android, it’s APP to you!
How do I apply?

Create a great team!

Find an outstanding
idea!

Complete a simple
form!
Let’s get to the point!
      OOP, here we come!
Basic Concepts
Class - Blueprint, used to create instances of
itself

Object / Instance - Instances are class
occurrences

Method - Function / Procedure of an object
or class

Attribute - Fields with values (objects) in a
object
Pros

Code decoupling, enforces code reusability

Associates data structures with their related
methods

Makes real-world object representation
easier
Inheritance

Classes can extend
other classes

  They inherit their
  attributes and
  methods

  Can extend only
  one class
name
                 Human          surname
                Walks, Sleeps      sex




                no of toys                job position
   Kid         school grade     Adult       company
Plays, Cries   no of friends      Works      vat no




                  Example
Example
public class Hello {

    public static void main(String[] argv) {

        System.out.println(getHelloString());
    }

    private static String getHelloString() {

        return "Hello";
    }
}

public class HelloWorld extends Hello {

    @Override
    private static String getHelloString() {

        return "Hello, world!";
    }
}
Interfaces


Make a class implement certain functionality

A class can implement more than one
interfaces
Fema
                                   le Ad
                                        ult

       Example                         Kid
                                   ale
    Male          Female          M
                                  Fe
Watch football     Cook              male
    Snore      Be grumpy for
                                            Hu
                 no reason                       ma
                                                   n
Example
public class Human {

    abstract void sayHi();
    abstract void sayGoodBye();
}

public class Eestecer implements Human {

    @Override
    private static String sayHi() {

        System.out.println("Hello guys!");
    }

    @Override
    private static String sayGoodBye() {

        System.out.println("Goodbye... Keep partying!");
    }
}
OOP Languages
C++

Ruby

Python

C#

VB.NET

...And, wait for it...
Java-dive!
Let’s take a fast look
Java, at a glance
        C-like syntax
Created in Sun Microsystems,
      by James Gosling
  Now acquired by Oracle
Hello, Java World!


public class HelloJava {

    public static void main(String[] argv) {

      System.out.println(“Hello, Java World!”);
}
Great Things about Java

 Has a garbage collector, simply do not care
 about memory leakage!

 Your program fails, except exceptions!

 Is platform-independent, runs in it’s own VM,
 the JVM
Garbage Collector
Java objects leave in
a heap

When the Garbage
Collector needs to
release memory, it
starts removing
dangling objects

Slightly pauses the
application threads
Exceptions


Java gives you the chance to get a bit off
track, but then makes sure you can handle
unwanted situations

You can try something weird and if it turns
bad, you handle the exception
Example


try {

    something that might destroy the universe

catch (EarlyDestructionExcpetion e) {

    save the world
}
Say hello, to my Green
        friend
The mystery, explained...
 Complete software stack

   Operating System

   Middleware

   Key Applications

 Open Source Developed by the Open Handset
 Alliance

 Fastest growing market

   Platform with the most devices activations
Android, bottoms up!
Setup a new project
Activity

Creates a window, so that the user can
interact with the app

Can communicate with the system

Controls the higher level of the user
interface
Activity, get a
       life!
The lifecycle of an Activity is
       really important.

Listen to Lifecycle events, in
order to save and reproduce
    the state of the app
Tasks for next time
1. Create an application      3. When the button is
   that asks for the user’s      pressed, a clear button
   name                          appears that resets
                                 everything
2. Then, after hitting a
   button, it populates a       Hint: Check the
   text view with a             following classes:
   personalized message         TextView, EditText,
   for the user                 Button and
                                OnClickListener

Mais conteúdo relacionado

Semelhante a EESTEC Android Workshops - 101 Java, OOP and Introduction to Android

Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014hwilming
 
Module 10-Introduction to OOP.pptx
Module 10-Introduction to OOP.pptxModule 10-Introduction to OOP.pptx
Module 10-Introduction to OOP.pptxssuserec53e73
 
Introduction to Java programming - Java tutorial for beginners to teach Java ...
Introduction to Java programming - Java tutorial for beginners to teach Java ...Introduction to Java programming - Java tutorial for beginners to teach Java ...
Introduction to Java programming - Java tutorial for beginners to teach Java ...Duckademy IT courses
 
Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.Peter Higgins
 
Java history, versions, types of errors and exception, quiz
Java history, versions, types of errors and exception, quiz Java history, versions, types of errors and exception, quiz
Java history, versions, types of errors and exception, quiz SAurabh PRajapati
 
Internet programming slide - java.ppt
Internet programming slide - java.pptInternet programming slide - java.ppt
Internet programming slide - java.pptMikeAdva
 
Interfaces & Abstract Classes
Interfaces & Abstract ClassesInterfaces & Abstract Classes
Interfaces & Abstract ClassesBharat17485
 
Java object oriented programming - OOPS
Java object oriented programming - OOPSJava object oriented programming - OOPS
Java object oriented programming - OOPSrithustutorials
 
Testing And Drupal
Testing And DrupalTesting And Drupal
Testing And DrupalPeter Arato
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010Rich Helton
 
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsAjax Experience 2009
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software DevelopmentZeeshan MIrza
 

Semelhante a EESTEC Android Workshops - 101 Java, OOP and Introduction to Android (20)

Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
 
Module 10-Introduction to OOP.pptx
Module 10-Introduction to OOP.pptxModule 10-Introduction to OOP.pptx
Module 10-Introduction to OOP.pptx
 
Introduction to Java programming - Java tutorial for beginners to teach Java ...
Introduction to Java programming - Java tutorial for beginners to teach Java ...Introduction to Java programming - Java tutorial for beginners to teach Java ...
Introduction to Java programming - Java tutorial for beginners to teach Java ...
 
Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.Your Library Sucks, and why you should use it.
Your Library Sucks, and why you should use it.
 
Java history, versions, types of errors and exception, quiz
Java history, versions, types of errors and exception, quiz Java history, versions, types of errors and exception, quiz
Java history, versions, types of errors and exception, quiz
 
Internet programming slide - java.ppt
Internet programming slide - java.pptInternet programming slide - java.ppt
Internet programming slide - java.ppt
 
OOP Basic Concepts
OOP Basic ConceptsOOP Basic Concepts
OOP Basic Concepts
 
Interfaces & Abstract Classes
Interfaces & Abstract ClassesInterfaces & Abstract Classes
Interfaces & Abstract Classes
 
Java object oriented programming - OOPS
Java object oriented programming - OOPSJava object oriented programming - OOPS
Java object oriented programming - OOPS
 
Testing And Drupal
Testing And DrupalTesting And Drupal
Testing And Drupal
 
Hello java
Hello java   Hello java
Hello java
 
Hello Java-First Level
Hello Java-First LevelHello Java-First Level
Hello Java-First Level
 
Hello java
Hello java  Hello java
Hello java
 
Do while loop
Do while loop Do while loop
Do while loop
 
Goodparts
GoodpartsGoodparts
Goodparts
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010
 
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation Goodparts
 
Introduction to OOP.pptx
Introduction to OOP.pptxIntroduction to OOP.pptx
Introduction to OOP.pptx
 
Introduction to Software Development
Introduction to Software DevelopmentIntroduction to Software Development
Introduction to Software Development
 

Mais de Antonis Kalipetis

EESTEC Android Workshops - Recap
 EESTEC Android Workshops - Recap EESTEC Android Workshops - Recap
EESTEC Android Workshops - RecapAntonis Kalipetis
 
EESTEC Android Workshops - 103 The Internet and JSON
 EESTEC Android Workshops - 103 The Internet and JSON EESTEC Android Workshops - 103 The Internet and JSON
EESTEC Android Workshops - 103 The Internet and JSONAntonis Kalipetis
 

Mais de Antonis Kalipetis (7)

Docker and WASM
Docker and WASMDocker and WASM
Docker and WASM
 
EESTEC Android Workshop 4
EESTEC Android Workshop 4EESTEC Android Workshop 4
EESTEC Android Workshop 4
 
EESTEC Android Workshop 3
EESTEC Android Workshop 3EESTEC Android Workshop 3
EESTEC Android Workshop 3
 
EESTEC Android Workshop 2
EESTEC Android Workshop 2EESTEC Android Workshop 2
EESTEC Android Workshop 2
 
EESTEC Android Workshop 1
EESTEC Android Workshop 1EESTEC Android Workshop 1
EESTEC Android Workshop 1
 
EESTEC Android Workshops - Recap
 EESTEC Android Workshops - Recap EESTEC Android Workshops - Recap
EESTEC Android Workshops - Recap
 
EESTEC Android Workshops - 103 The Internet and JSON
 EESTEC Android Workshops - 103 The Internet and JSON EESTEC Android Workshops - 103 The Internet and JSON
EESTEC Android Workshops - 103 The Internet and JSON
 

EESTEC Android Workshops - 101 Java, OOP and Introduction to Android

  • 1. EESTEC Android Workshops 101 - Introduction to OOP, Java and Android
  • 2. What we’ll cover today EESTEC, Android, it’s APP to you! Introduction to OOP Introduction to Java Setting up the Android Environment Running your first App
  • 4. How do I apply? Create a great team! Find an outstanding idea! Complete a simple form!
  • 5. Let’s get to the point! OOP, here we come!
  • 6. Basic Concepts Class - Blueprint, used to create instances of itself Object / Instance - Instances are class occurrences Method - Function / Procedure of an object or class Attribute - Fields with values (objects) in a object
  • 7. Pros Code decoupling, enforces code reusability Associates data structures with their related methods Makes real-world object representation easier
  • 8. Inheritance Classes can extend other classes They inherit their attributes and methods Can extend only one class
  • 9. name Human surname Walks, Sleeps sex no of toys job position Kid school grade Adult company Plays, Cries no of friends Works vat no Example
  • 10. Example public class Hello { public static void main(String[] argv) { System.out.println(getHelloString()); } private static String getHelloString() { return "Hello"; } } public class HelloWorld extends Hello { @Override private static String getHelloString() { return "Hello, world!"; } }
  • 11. Interfaces Make a class implement certain functionality A class can implement more than one interfaces
  • 12. Fema le Ad ult Example Kid ale Male Female M Fe Watch football Cook male Snore Be grumpy for Hu no reason ma n
  • 13. Example public class Human { abstract void sayHi(); abstract void sayGoodBye(); } public class Eestecer implements Human { @Override private static String sayHi() { System.out.println("Hello guys!"); } @Override private static String sayGoodBye() { System.out.println("Goodbye... Keep partying!"); } }
  • 16. Java, at a glance C-like syntax Created in Sun Microsystems, by James Gosling Now acquired by Oracle
  • 17. Hello, Java World! public class HelloJava { public static void main(String[] argv) { System.out.println(“Hello, Java World!”); }
  • 18. Great Things about Java Has a garbage collector, simply do not care about memory leakage! Your program fails, except exceptions! Is platform-independent, runs in it’s own VM, the JVM
  • 19. Garbage Collector Java objects leave in a heap When the Garbage Collector needs to release memory, it starts removing dangling objects Slightly pauses the application threads
  • 20. Exceptions Java gives you the chance to get a bit off track, but then makes sure you can handle unwanted situations You can try something weird and if it turns bad, you handle the exception
  • 21. Example try { something that might destroy the universe catch (EarlyDestructionExcpetion e) { save the world }
  • 22. Say hello, to my Green friend
  • 23. The mystery, explained... Complete software stack Operating System Middleware Key Applications Open Source Developed by the Open Handset Alliance Fastest growing market Platform with the most devices activations
  • 25. Setup a new project
  • 26. Activity Creates a window, so that the user can interact with the app Can communicate with the system Controls the higher level of the user interface
  • 27. Activity, get a life! The lifecycle of an Activity is really important. Listen to Lifecycle events, in order to save and reproduce the state of the app
  • 28. Tasks for next time 1. Create an application 3. When the button is that asks for the user’s pressed, a clear button name appears that resets everything 2. Then, after hitting a button, it populates a Hint: Check the text view with a following classes: personalized message TextView, EditText, for the user Button and OnClickListener