Android (and SVN) lecture

4 downloads 184 Views 1MB Size Report
Oct 30, 2012 ... http://developer.android.com/reference/android/app/Activity.html. Delphine ... Note the format to refer to strings (
Android

(and SVN)

lecture

Delphine Szymczak Certec, Department of Design Sciences Lund University

October 30, 2012

Outline 1 Android Operating System 2 Applications and Flow in Android

Activities Services Intents 3 Tools

Android SDK Debugging - DDMS 4 Haptimap toolkit 5 Demo 6 SVN - subversion repositories

Delphine Szymczak, Android and SVN lecture, Advanced Interaction Design course, LTH

Outline 1 Android Operating System 2 Applications and Flow in Android

Activities Services Intents 3 Tools

Android SDK Debugging - DDMS 4 Haptimap toolkit 5 Demo 6 SVN - subversion repositories

Delphine Szymczak, Android and SVN lecture, Advanced Interaction Design course, LTH

Android What are we talking about?

I

An Open Platform for Mobile Development

I

NOT a mobile phone

I

a package of preinstalled applications

I

a software development kit used to create applications

I

a free mobile Operating System

I

builds on a Linux Kernel, but not a Linux OS : a full set of std Linux utilities not included

I

development possible from different platforms (Windows, Linux, Mac) using Java

Delphine Szymczak, Android and SVN lecture, Advanced Interaction Design course, LTH

Android OS System Architecture

I

C++ below Dalvik, Java above

I

abstraction layers

I

code at applications level and call on the application framework

http://source.android.com/tech/security/ I

Process isolation

I

Application-defined and user-granted permissions (in AndroidManifest.xml)

Delphine Szymczak, Android and SVN lecture, Advanced Interaction Design course, LTH

Outline 1 Android Operating System 2 Applications and Flow in Android

Activities Services Intents 3 Tools

Android SDK Debugging - DDMS 4 Haptimap toolkit 5 Demo 6 SVN - subversion repositories

Delphine Szymczak, Android and SVN lecture, Advanced Interaction Design course, LTH

Applications in Android

I

A collection of one or more tasks (activities or services) plus a Linux process to contain them

I

Multiple applications can run concurrently

I

Can be interrupted and paused when events occur

I

Only one visible application at a time

I

Either an Activity with a visible screen ...

I

...or a Service without a graphical user interface

Delphine Szymczak, Android and SVN lecture, Advanced Interaction Design course, LTH

Activities in Android Visible screen in the application

I

A task or purpose

I

A user interface screen

I

It has its own life cycle They extend the Context class (you can get global info about your application) http://developer.android.com/reference/

I

android/content/Context.html

Delphine Szymczak, Android and SVN lecture, Advanced Interaction Design course, LTH

Activities in Android An activity’s lifecycle

Some @Override methods I

onCreate() Creates the layout, data binding, contentview

I

onResume() Appropriate place to load resources (e.g. starting audio, video...)

I

onPause() e.g. stop audio, video started at onResume() Need to return before a new foreground Activity can start.

I

onStop() and onDestroy() might not be executed at all (before version 3.0 Honeycomb)

Delphine Szymczak, Android and SVN lecture, Advanced Interaction Design course, LTH

Activities in Android Restoring a killed activity

Your activity can be killed to retrieve memory resources when it is not in the foreground. The last method executed before it is killable is onPause() (