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
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
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
}
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
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