introduction to android - aalto universityincome shared 70/30 ! ... action bar ! compatibility !...

31
Introduction to Android T-110.5130 Mobile Systems Programming

Upload: lamphuc

Post on 25-Mar-2018

218 views

Category:

Documents


1 download

TRANSCRIPT

Introduction to Android T-110.5130 Mobile Systems Programming

Credits

!   Lecture and slides inspired by presentation given by Claudio Camacho and Ramon Sadornil from Android Aalto

! androidaalto.org

! www.claudiocamacho.com

! www.jush.org

30.1.2013 Kimmo Ahokas 2

Content

!   Android background

!   Design

!   Developing for Android

!   Android API

30.1.2013 Kimmo Ahokas 3

What is Android?

!   The world’s most popular mobile platform

!   675 000 Apps available in Google Play Store

!   First phone in 2008

!   Linux kernel

! Dalvik virtual machine

30.1.2013 Kimmo Ahokas 4

Android runs everywhere!

30.1.2013 Kimmo Ahokas 5

Android

!   Developed by Google

!   Open source

!   Free to use

!   Free SDK

30.1.2013 Kimmo Ahokas 6

Android Market

!   Easiest way to distribute software !   Not the only way

!   25€ starting fee

!   Income shared 70/30

!   No approval process, apps published in hours

!   In-app billing possible

30.1.2013 Kimmo Ahokas 7

Software versions

30.1.2013 Kimmo Ahokas 8

Design

30.1.2013 Kimmo Ahokas 9

Design Principles

!   Enchant Me

!   Simplify My Life

!   Make Me Amazing

30.1.2013 Kimmo Ahokas 10

Style

!   Flexible layouts

!   Themes

!   Feedback

!   Colors

!   Fonts

!   Icons

30.1.2013 Kimmo Ahokas 11

Patterns

!   Consistent user experience

!   Action Bar

!   Compatibility

!   Accessibility

!   Pure Android

30.1.2013 Kimmo Ahokas 12

Building Blocks

!   Ready-to-use elements

!   Tabs

!   Lists

!   Selectors

!   Dialogs

!   Progress

30.1.2013 Kimmo Ahokas 13

Developing for Android

30.1.2013 Kimmo Ahokas 14

Android SDK

!   Based on Eclipse and ADT plugin

!   Android SDK Tools

!   Android Platform-tools

!   Android Platform

!   Android system image for emulator

!   Get it: http://developer.android.com/sdk/index.html

30.1.2013 Kimmo Ahokas 15

Other development options

!   Not supported by Google or this course !   You can still use them if you want to

! IntelliJ IDEA !   Alternative for Eclipse

!   Vim, emacs and other text editors !   Download Android sdk tools and use Ant for building

30.1.2013 Kimmo Ahokas 16

Project Structure

30.1.2013 Kimmo Ahokas 17

!   Android Manifest

!   Source files

!   Binaries (NDK)

!   Libraries

!   Resources

Android Emulator

!   Run any version of Android

!   All different screen sizes available

!   Limit network speed

!   Emulate phone calls and sms messages

!   Screenshots

!   Mock locations

!   Lot more stuff hidden

30.1.2013 Kimmo Ahokas 18

Devices

!   Testing with real device

!   Enable USB debugging

!   Drivers !   OS X has built in drivers

!   In windows different drivers for every device

30.1.2013 Kimmo Ahokas 19

Debugging

!   Debugger

!   Test Framework

!   Code coverage

! Monkeyrunner

30.1.2013 Kimmo Ahokas 20

Android API

30.1.2013 Kimmo Ahokas 21

Activity

30.1.2013 Kimmo Ahokas 22

Fragment

30.1.2013 Kimmo Ahokas 23

Intent

!   Start other activities !   Even activities that are

not part of your own app!

!   Maybe the most powerful feature of Android

!   Share stuff via any installed app

!   Offer services for other apps

30.1.2013 Kimmo Ahokas 24

Notifications

!   Inform users about events in your app

!   Jelly Bean added basic interaction

30.1.2013 Kimmo Ahokas 25

Network

! HttpUrlConnection

! Never use any network api in your main thread! !   The UI hangs on older versions

!   Android 3.0 and later won’t allow it at all

30.1.2013 Kimmo Ahokas 26

Location

!   Locate user

!   Fine vs. Coarse location

!   Google Maps API

30.1.2013 Kimmo Ahokas 27

Native Development Kit

!   Native C and C++ code for Android

!   High performance but not so portable

!   Compile at least for ARM, preferably for x86 and MIPS

!   Adds complexity, try to avoid NDK

!   If Android API provides something, use it instead of NDK

!   Signal processing, physics

30.1.2013 Kimmo Ahokas 28

Other Things

!   Android Support Library

!   API examples

!   Project & Activity templates

! ActionBarSherlock

30.1.2013 Kimmo Ahokas 29

Excellent sources

! http://developer.android.com/index.html

! http://www.androiduipatterns.com/

! http://www.androidpatterns.com/

! http://androidaalto.org/

30.1.2013 Kimmo Ahokas 30

Contact

!   Questions Concerning Android project in Mobile Systems Programming course?

!   IRC: KimiA @IRCnet (probably fastest)

!   Mail: [email protected]

30.1.2013 Kimmo Ahokas 31