Beruflich Dokumente
Kultur Dokumente
LECTURE # 2
Introduction to
Java
Language
What is Java?
Java is a computer programming Language
just like
◦ C
◦ C++
◦ Objects
◦ Classes
◦ Methods
◦ Encapsulation
◦ Inheritance
◦ Polymorphism
Object in OOP
Drive()
Everything is an Object
EngineStart()
EngineStop()
An Object Vehicle
◦ Knows something • type
• color
◦ Does something • name
System.out.println("Hello World!");
}
} String to be displayed
Encapsulation
• Makes the data private
• Others can use only the data you want them to use
Access Modifiers
• Private
• Public
• protected
Some other Objects
Button Song
• Label • Title
• Color Variable • Duration
• getLabel() • getTitle()
• getColor() • getDuration()
setLabel() Method
• • setTitle()
• setColor() • setDuration()
• click() • play()
• Variable
• Methods
Sub class
Polymorphism
Polymorphism
Abstract Classes
Abstract Classes
• Some classes should not instantiate
• Abstract classes should always be extended
• We will never create an object of that class
• We can however make reference for that class
• Some general classes have no definition as object instantiation
• Vehicle
• Animal
abstract class Vehicle abstract public class Vehicle
{ {
public void drive() public void drive()
{ {
} }
} }
Abstract Classes
abstract public class Vehicle
{
public void drive()
{
}
}
http://source.android.com/
Connectivity
◦ GSM
◦ CDMA
◦ LTE
◦ Wi-Fi
◦ WiMax
Messaging
Multitouch
Multitasking
Android Architecture
Android Architecture
Linux Kernel
◦ Android runs on Linux Kernel 3.18
◦ Android because of its foundation on Linux Kernel contains all the basic
functionality of Linux e.g. Memory Management.
◦ A device with certain hardware should have a proper driver in the Linux
Kernel to work properly
◦ Bluetooth will not work until the driver is available for that hardware.
Android Architecture
Libraries
◦ Android contains some core libraries which help build different other
libraries.
◦ Core Libraries
◦ It contains different libraries from Java SE and Java ME
Android Architecture
Application Framework
◦ As a developer we directly interact with this layer.
◦ This layer contains libraries which provide basic functionality for android
like call, messaging and resource management etc.
◦ Messaging
◦ Mail
Android Smart Phones
Scandinavia Android TV
Mashup Compatibility
Combination of two or more service to create an App.
◦ Geolocation + Gaming
◦ Camera + Geolocation
◦ Contacts + Maps
Components of Android
Programming
Activities
◦ Android Application are composed Activity
of Activities
◦ User Interface
◦ Multitouch gestures
◦ Zooming
◦ Dragging
◦ Context Menu
◦ Checkboxes
◦ DatePickers etc.
Components of Android
Programming
Background Service
Any PC running
◦ Windows
◦ Mac OS X
◦ Linux
Android Studio
JDK