49
1 Introduction of Android Application I Komang Sugiartha, S.Kom., MMSI

Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

  • Upload
    lykhue

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

1

Introduction of Android

Application

I Komang Sugiartha, S.Kom., MMSI

Page 2: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Resume

• 2010 : S1 Sistem Informasi Universitas Gunadarma

• 2014 : S2 Magister Manajemen Sistem Informasi Universitas Gunadarma

• 2017 - Now : S3 Teknlogi Informasi Universitas Gunadarma

• 2016 – Now : Dosen Universitas Gunadarma

• 2016 – Now : Staff Incubator Business Center - UG

• 2015 – Now : Head of Robotics and Course Development Robot Edukasi

• 2018 - Now : Co-Founder of KemangKres

Page 3: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

3

What is Android?

A Software platform and operating system for mobile.

Based on the Linux kernel.

Android was found way back in 2003.

It was developed in Palo Alto, California.

Android was purchased by the GOOGLE in AUGUST,2005 for US$ 50 million.

Page 4: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Android OS

An open-source operating system based on the Linux kernel

Designed primarily for touchscreen mobile devices such as smartphones and tablet computers

1 billion Android devices have been activated

48 billion apps have been installed

Page 5: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

5

Phones

HTC G1,Droid,Tattoo

Motorola Droid (X)

Suno S880 Samsung Galaxy Sony Ericsson

Page 6: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

6

Tablets

Velocity Micro Cruz Gome FlyTouch Acer beTouch

Dawa D7

Toshiba Android SmartBook

Cisco Android Tablet

Page 7: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

7

Others

Watches

SmartTV

Google Glasses

Portable/CarDevices

Page 8: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

8

Market Share Smartphone

(Q2 2018): 88%Source (https://www.statista.com/statistics/266136/global-market-share-held-by-smartphone-operating-systems)

Page 9: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Android Architecture

Page 10: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

10

Android S/W Stack - Application

Android provides a set of core applications:

Email Client

SMS Program

Calendar

Maps

Browser

Contacts

Etc

All applications are written using the Java language.

Page 11: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

11

Android S/W Stack –

App Framework

Enabling and simplifying the reuse of components

Developers have full access to the same framework APIs used by the core applications.

Users are allowed to replace components.

Page 12: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

12

Android S/W Stack –

App Framework (Cont)

FeaturesFeature Role

View System

Used to build an application, including lists, grids, textboxes, buttons, and embedded web browser

Content Provider

Enabling applications to access data from other applications or to share their own data

Resource Manager

Providing access to non-code resources (localized strings, graphics, and layout files)

Notification Manager

Enabling all applications to display customer alerts in the status bar

Activity Manager

Managing the lifecycle of applications and providing a common navigation backstack

Page 13: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

13

Android S/W Stack - Libraries

Including a set of C/C++ libraries used by components of the Android system

Exposed to developers through the Android application framework

Page 14: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

14

Android S/W Stack - Runtime

Core Libraries

Providing most of the functionality available in the core libraries of the Java language

APIs

Data Structures

Utilities

File Access

Network Access

Graphics

Etc

Page 15: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

15

JVM

Page 16: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

16

Android S/W Stack – Runtime

(Cont)

Dalvik Virtual Machine

Providing environment on which every Android application runs

Each Android application runs in its own process, with its own instance of the Dalvik VM.

Dalvik has been written such that a device can run multiple VMs efficiently.

Register-based virtual machine

Page 17: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

17

Android S/W Stack – Runtime

(Cont)

Dalvik Virtual Machine (Cont)

Executing the Dalvik Executable (.dex) format

.dex format is optimized for minimal memory footprint.

Compilation

Relying on the Linux Kernel for:

Threading

Low-level memory management

Page 18: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

18

Android S/W Stack – Linux Kernel

Relying on Linux Kernel 2.6 for core system services

Memory and Process Management

Network Stack

Driver Model

Security

Providing an abstraction layer between the H/W and the rest

of the S/W stack

Page 19: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

19

Development Tools

MIT App Inventor

Cordova

Android Studio

Page 20: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

20

MIT App Inventor

Easy for learners to create mobile apps for Android smart phones

Visually fitting together puzzle piece-shaped "programming blocks"

Web-based

1st quarter of 2012, MIT Center for Mobile Learning launched App Inventor service for general public access

Page 21: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

21

MIT App Inventor

Programming Blocks

Page 22: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

22

MIT App Inventor

(Component Designer)

Page 23: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

23

MIT App Inventor

(Block Editor)

Page 24: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

24

Cordova

Apache Cordova is a platform for building natively installed mobile applications using HTML, CSS and JavaScript

Page 25: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

25

Cordova

Apache Cordova was originally called Phonegap build by Nitobi

Open-source & free software from the beginning (MIT License), Apache License now

PhoneGap is still a product of Adobe. It is a distribution of Apache Cordova.

Page 26: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

26

Cordova Application

Page 27: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

27

Android Studio (Getting Started 1) Need to install Java Development Kit (JDK) to write

Java (and Android) programs Do not install Java Runtime Environment (JRE);

JDK and JRE are different! Can download the JDK for your OS at

http://java.oracle.com Alternatively, for OS X, Linux:

OS X: Open /Applications/Utilities/Terminal.app Type javac at command line

Install Java when prompt appears Linux:

Type sudo apt–get install default–jdk at command line (Debian, Ubuntu)

Other distributions: consult distribution’s documentation

Page 28: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

28

Install!

28

Page 29: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

29

Android Studio (Getting Started 2)

After installing JDK, download Android SDK from http://developer.android.com

Simplest: download and install Android Studio bundle (including Android SDK) for your OS

Alternatives: Download/install Android Developer Tools

from this site (based on Eclipse) Install Android SDK tools by themselves,

then install ADT for Eclipse separately (from this site)

We’ll use Android Studio with SDK included (easy)

Page 30: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

@2011 Mihail L. Sichitiu 30

Install!

30

Page 31: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Android Studio (Getting Started 3)

Install Android Studio directly (Windows, Mac); unzip to directory android-studio, then run ./android-studio/bin/studio.sh(Linux)

You should see this:

@2011 Mihail L. Sichitiu 31

Page 32: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Creating Android App (1)

Creating Android app project in Android Studio:

Go to File→New Project

Enter app, project name

Choose package name using “reverse URL” notation, e.g., edu.osu.myapp

Select APIs for app, then click Next

32

Page 33: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Creating Android App (2)

Determine what kind of Activity to create; then click Next

We’ll choose a Blank Activity for simplicity

Enter information about your Activity, then click Finish

This creates a “Hello World” app

33

Page 34: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Deploying the App

Two choices for deployment: Real Android device

Android virtual device

Plug in your real device; otherwise, create an Android virtual device

Emulator is slow. Try Intel accelerated version, or perhapshttp://www.genymotion.com/

Run the app: press “Run” button in toolbar

34

Page 35: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Project structure

35

App manifest

Java code

Resources

Build scripts

Page 36: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

36

Android Manifest

Its main purpose in life is to declare the components to the system:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.example.demo">

<application

android:allowBackup="true"

android:icon="@mipmap/ic_launcher"

android:label="@string/app_name"

android:supportsRtl="true"

android:theme="@style/AppTheme">

<activity

android:name="com.example.demo.MainActivity"

android:label="@string/app_name"

android:theme="@style/AppTheme.NoActionBar">

<intent-filter>

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>

</activity>

</application>

</manifest>

Page 37: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

37

Activity life cycle

An Android activity is focused on a single thing a user can do.

Most applications have multiple activities

Page 38: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Layouts

38

Page 39: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

LinearLayout

A Layout that arranges its children in a single column or a single row.

39

<LinearLayout

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical">

</LinearLayout>

Page 40: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

RelativeLayout

A Layout where the positions of the children can be described in relation to each other or to the parent.

40

Child 1 is relative to the top left corner of the screen.

Child 2 is relative to the center of the screen.

Child 3 is positioned below child 2

Page 41: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

FrameLayout

A layout that stacks views along the z-axis.

41

Page 42: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Demo Apps – MIT App InventorSource

(https://play.google.com/store/apps/details?id=com.thunkable.android.sugiartha26

.AppsRobotEdukasi)

42

Page 43: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Demo Apps – CordovaSource

(https://play.google.com/store/apps/details?id=com.robotedukasi.belajars4aarduino)

43

Page 44: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Demo Apps – Android StudioSource

(https://play.google.com/store/apps/details?id=com.smartgarden.smartgardenbali)

44

Page 45: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Demo Apps – Android Studio

Sistem Akademik Sekolah

45

Page 46: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Dashboard

@2011 Mihail L. Sichitiu 46

Page 47: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Demo Apps – Android Studio

Smart Tourism

@2011 Mihail L. Sichitiu 47

Page 48: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

Dashboard

@2011 Mihail L. Sichitiu 48

Page 49: Introduction of Android Applicationsugiartha.staff.gunadarma.ac.id/Downloads/files/65721/Introduction+of+Android...Resume • 2010 : S1 Sistem Informasi Universitas Gunadarma • 2014

TERIMA KASIH

@2011 Mihail L. Sichitiu 49