Top Banner
Arif Akbarul Huda Android Developer di qiscus Penulis buku “Livecoding! 9 Aplikasi Android Buatan Sendiri” [email protected] (email) | @omayib (Twitter) “jika pelukis memilki kanvas untuk mencurahkan imajinasinya, Maka programmer punya RAM yang bisa di manipulasi sesuai imajinasi”
36

Introducing Android Programming

Jul 18, 2015

Download

Software

Arif Huda
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introducing Android Programming

Arif Akbarul Huda

● Android Developer di qiscus● Penulis buku “Livecoding! 9 Aplikasi Android

Buatan Sendiri”● [email protected] (email) | @omayib

(Twitter)

“jika pelukis memilki kanvas untuk mencurahkan imajinasinya,Maka programmer punya RAM yang bisa di manipulasi sesuai

imajinasi”

Page 2: Introducing Android Programming

Good reference

● javatpoint.com/java-oops-concepts

● oodesign.com● c4learn.com● Livecoding! 9 Aplikasi Android Buatan Sendiri

Page 3: Introducing Android Programming

Kinds of Software engineer

Ref : http://blog.backand.com/frontend-backend-dev/

Page 4: Introducing Android Programming

Front end vs backendBuild amazing app that customer love to use

philosophy Build sterling architechture and

working infrastructure

“dude, it is all about UX and has to look good

Quoted saying If this approach doesnt work, lets try another

Angular,CSS,HTML5, Javascripte,Jquery,Bootst

rapp, ionic

Favorite touls PHP, C#, Ruby, py, MySQL,

Node.js, MongoDB

Creative, imaginative,innovative,

driven, emphaty,Curiosity, Personability

Strength Logical, analitical,flexible, organized,detail-oriented,

handle complexity

Kinds of Software engineer

Page 5: Introducing Android Programming

Mobile developer?

Page 6: Introducing Android Programming

World-wide Mobile Smartphone Sales

http://www.forbes.com/sites/louiscolumbus/2013/01/17/2013-roundup-of-mobility-forecasts-and-market-estimates/

Page 7: Introducing Android Programming

Mobile developer distribution

Page 8: Introducing Android Programming

Mobile tech

Page 9: Introducing Android Programming

Good Application should...

● Scalable● Maintenable● Reliable (no error)● Good UI & UX

Page 10: Introducing Android Programming

What is java?

1)Java is a high level, robust, secured and object-oriented programming language.

2)Platform: Any hardware or software environment in which a program runs, is known as a platform. Since Java has its own runtime environment (JRE) and API, it is called platform.

Page 11: Introducing Android Programming

Where is java used?

● Desktop Applications such as acrobat reader, media player, antivirus etc.

● Web Applications such as irctc.co.in, javatpoint.com etc.● Enterprise Applications such as banking applications.● Mobile● Embedded System● Smart Card● Robotics● Games etc.

Page 12: Introducing Android Programming

Types of Java Applications

1) Standalone ApplicationIt is also known as desktop application or window-based application. An application that we need to install on every machine such as media player, antivirus etc. AWT and Swing are used in java for creating standalone applications.2) Web ApplicationAn application that runs on the server side and creates dynamic page, is called web application. Currently, servlet, jsp, struts, jsf etc. technologies are used for creating web applications in java.3) Enterprise ApplicationAn application that is distributed in nature, such as banking applications etc. It has the advantage of high level security, load balancing and clustering. In java, EJB is used for creating enterprise applications.4) Mobile ApplicationAn application that is created for mobile devices. Currently Android and Java ME are used for creating mobile applications.

Page 13: Introducing Android Programming

Java Environment

● JDK● JRE● JVM● Dalvik VM (for android)

Page 14: Introducing Android Programming

Java Environment

JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.JVMs are available for many hardware and software platforms.The JVM performs following main tasks:● Loads code● Verifies code● Executes code● Provides runtime environment

Page 15: Introducing Android Programming

Java Environment

JRE is an acronym for Java Runtime Environment.It is used to provide runtime environment.It is the implementation of JVM.It physically exists.It contains set of libraries + other files that JVM uses at runtime.

Implementation of JVMs are also actively released by other companies besides Sun Micro Systems.

Page 16: Introducing Android Programming

Java Environment

JDK

JDK is an acronym for Java Development Kit.It physically exists.It contains JRE + development tools

Page 17: Introducing Android Programming

Java-some things that must be understood

● Object Oriented Programming Concept● (software) design pattern● (software architecture)

Page 18: Introducing Android Programming

Java-OOP

● Object● Class● Inheritance● Polymorphism● Abstraction● Encapsulation

Ref: http://www.javatpoint.com/java-oops-concepts

Page 19: Introducing Android Programming

Java-OOP-Object

An object has three characteristics:

state: represents data (value) of an object.behavior: represents the behavior (functionality) of an object such as deposit, withdraw etc.identity: Object identity is typically implemented via a unique ID. The value of the ID is not visible to the external user. But,it is used internally by the JVM to identify each object uniquely..Object is an instance of a class. Class is a template or blueprint from which objects are created. So object is the instance(result) of a class

Object : PencilState - name : Stadler- color : white- thicknes : 2BBehavior : drawing

Page 20: Introducing Android Programming

Java-OOP-Class

A class is a group of objects that has common properties. It is a template or blueprint from which objects are created. A class in java can contain:

● data member● method● constructor● block● class and interface

Page 21: Introducing Android Programming

Contoh Object dan Class

class Student1{

int id;//data member (also instance variable)

String name;//data member(also instance variable)

public static void main(String args[]){

Student1 s1=new Student1();//creating an object of Student

System.out.println(s1.id);

System.out.println(s1.name);

}

}

Page 22: Introducing Android Programming

Contoh Object dan Class

class Rectangle{ int length; int width; void insert(int l,int w){ length=l; width=w; } void calculateArea(){System.out.println(length*width);} public static void main(String args[]){ Rectangle r1=new Rectangle(); Rectangle r2=new Rectangle(); r1.insert(11,5); r2.insert(3,15); r1.calculateArea(); r2.calculateArea(); } }

Page 23: Introducing Android Programming
Page 24: Introducing Android Programming

Java-OOP-Inheritance

When one object acquires all the properties and behaviours of parent object i.e. known as inheritance. It provides code reusability. It is used to achieve runtime polymorphism.

Page 25: Introducing Android Programming

Java-OOP-Polymorphism

When one task is performed by different ways i.e. known as polymorphism. For example: to convense the customer differently, to draw something e.g. shape or rectangle etc.

Another example can be to speak something e.g. cat speaks meaw, dog barks woof etc.

Page 26: Introducing Android Programming

Java-OOP-Abstraction

Hiding internal details and showing functionality is known as abstraction. For example: phone call, we don't know the internal processing.

Page 27: Introducing Android Programming

Java-OOP-Encapsulation

Binding (or wrapping) code and data together into a single unit is known as encapsulation.

For example: capsule, it is wrapped with different medicines.

Page 28: Introducing Android Programming
Page 29: Introducing Android Programming

Android Application Component

Page 30: Introducing Android Programming

Activity

User interface yang bisa berinteraksi dengan user

Android Application Component

Page 31: Introducing Android Programming

Views

Button Textview EditText

Android Application Component

Page 32: Introducing Android Programming

Intent

Explicite : asking someone to do somethingImplicit : Asking the system who can do something

Contoh :oPindah halaman/activityoPanggil contactoPanggil GalleryoCall

Android Application Component

Page 33: Introducing Android Programming

broadcastreceiver

Contoh :oBatteray lowoPower offoBoot completedoPhone state

Listen to event

Android Application Component

Page 34: Introducing Android Programming

Push notification

Widget on home screen

Live walpaper

Animation & styling

Multitouch

Canvas/openGL

Android has Rich of Capabilites

Page 35: Introducing Android Programming

Supporting different device

Page 36: Introducing Android Programming

Sharedpreference File SQLite database

Saving data