distributed systems exercises · test your toolchain create an avd in the «android virtual device...

19
Distributed Systems Exercises 1 | Distributed Systems HS 2013 Matthias Kovatsch Matthias Kovatsch [email protected] Distributed Systems Exercises

Upload: others

Post on 08-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 1|Distributed Systems – HS 2013

Matthias Kovatsch

Matthias Kovatsch

[email protected]

Distributed Systems – Exercises

Page 2: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 2|Distributed Systems – HS 2013

Matthias Kovatsch

Programming exercises

Three assignments

One open project

Can be carried forward from last year

Theoretical exercises

Exam preparation for Part 1 (Mattern)

Assignments for Part 2 (Wattenhofer)

VS Exercises

Page 3: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 3|Distributed Systems – HS 2013

Matthias Kovatsch

Exam at the end of the semester up to 180 points

Improvement through the exercises

Programming exercises up to 45 points

Theoretical exercises in Part 2 up to 20 points

Participation required for «Save-point»

Total for grading up to 245 points

We take your best result when all save-points are reached

Out of 245 points total or out of 180 points exam only

Last year 96% improved their grade through the exercises

Grading System with «Save-Points»

Page 4: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 4|Distributed Systems – HS 2013

Matthias Kovatsch

Mobile Platform for Distributed Systems

Page 5: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 5|Distributed Systems – HS 2013

Matthias Kovatsch

Android Smartphone Market Share (U.S. 13+)

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

Okt 09Jan 10Apr 10Jul 10Okt 10Jan 11Apr 11Jul 11Okt 11Jan 12Apr 12Jul 12Okt 12

Jan 13Apr 13

Jul 13

Apple

Google

RIM

Microsoft

Palm

Page 6: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 6|Distributed Systems – HS 2013

Matthias Kovatsch

Platform Internals

Hardware

Linux Kernel

Memory

Management

Process

Management

Network

Stack

I/O

Display

Keypad

Touchscreen

Power

Management

Other Drivers

WiFi, Bluetooth, Camera,

Audio, Telephony, Flash,

Sensors

Dalvik

Virtual Machine

Android

Application A

Dalvik

Virtual Machine

Android

Application B

Dalvik

Virtual Machine

Android

Application C

Security

Linux

User A

Linux

User B

Linux

User C

Page 7: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 7|Distributed Systems – HS 2013

Matthias Kovatsch

Android Key Terms

«Activity»

Logical unit of a user activity

(like window in a computer program)

Usually full-screen (cf. Fragments)

«View»

Hierarchical UI element

Combined in layouts and

extended to Widgets with more functionality

«Service»

Background activity without UI, e.g., music player or FTP server

Page 8: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 8|Distributed Systems – HS 2013

Matthias Kovatsch

Android Key Terms

«Intent»

Starts or switches between «Activities»

Passive data structure

Describes the action

An explicit class to activate

Or Implicit components that match an «Intent filter»

«BroadcastReceiver»

Listens for global events (Intents)

e.g., «headphones were plugged» sent by system

Can deligate to preferred Activity

Can inform the user

Page 9: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 9|Distributed Systems – HS 2013

Matthias Kovatsch

Activity Lifecycle

Multi-Tasking

OS keeps apps alive

as long as possible

On memory shortage,

processes are killed

according to their priority

States of an Activity

Running (Resumed)

Paused

Stopped

Finished/killed

Page 10: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 10|Distributed Systems – HS 2013

Matthias Kovatsch

Programming Exercises

Page 11: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 11|Distributed Systems – HS 2013

Matthias Kovatsch

Team

Leyna SadamoriMatthias Kovatsch Marian George Hông-Ân Cao

Page 12: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 12|Distributed Systems – HS 2013

Matthias Kovatsch

Organization

Teams of two (sometimes three)

Develop with the emulator

Test on the actual phone

Document your work in a report

Smart phones

Use your own Android – no rooting required

HTC Desires with Android 4.2.2 available by us

Grading

Per group

Can be carried forward from/to last year

Page 13: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 13|Distributed Systems – HS 2013

Matthias Kovatsch

Schedule

A1: GUI and hardware

30 Sep 2013 – 14 Oct 2013 (2 weeks)

A2: Client/server, Web services, and the Cloud

14 Oct 2013 – 28 Oct 2013 (2 weeks)

A3: Group communication and logical time

28 Oct 2013 – 11 Nov 2013 (2 weeks)

A4: Open project (with presentation)

11 Nov 2013 – 20 Dec 2013 (5.5 weeks)

Page 14: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 14|Distributed Systems – HS 2013

Matthias Kovatsch

Homework

Page 15: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 15|Distributed Systems – HS 2013

Matthias Kovatsch

Create Groups

Log in to submission system

https://www.vs.inf.ethz.ch/edu/vs/submissions/

Will open soon

Leader starts a group

Add partner(s)

Specify which phone you will be using

Own device

One of our HTC Desires

Page 16: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 16|Distributed Systems – HS 2013

Matthias Kovatsch

Get a Phone if Necessary

Some HTC Desires available

Updated to CyanogenMod 10.1 (Android 4.2.2)

When: Wednesday 12pm – 1pm

Where: CNB H 108

Familiarize yourself with the device

Activate debugging when using your own

«Settings > About phone > Build number» – Tab several times

«Settings > Developer options > Android debugging»

Page 17: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 17|Distributed Systems – HS 2013

Matthias Kovatsch

Install the Toolchain

Java SE JDK

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Android SDK: ADT Bundle including Eclipse

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

Use Android SDK Manger to get

Android 4.2.2 or the version of your phone

Google USB Driver (Windows only)

Device driver

Android Composite ADB Interface

Google for your OS / device combination

Page 18: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 18|Distributed Systems – HS 2013

Matthias Kovatsch

Test Your Toolchain

Create an AVD in the «Android Virtual Device Manager»

Device: Nexus One (similar to HTC Desire)

Target: Android 4.2.2 - API Level 17

Back Camera: Emulated

Emulator Options: Snapshot

Create an «Android Sample Project» in Eclipse

New > Other > Android

Sample: ApiDemos

Run the project as Android application

On the AVD

On your phone

Page 19: Distributed Systems Exercises · Test Your Toolchain Create an AVD in the «Android Virtual Device Manager» Device: Nexus One (similar to HTC Desire) Target: Android 4.2.2 - API

Distributed Systems – Exercises 19|Distributed Systems – HS 2013

Matthias Kovatsch

Android Tutorial

Friday, 27 September 2013

Introduction to Android programming

«Live-Hacking» together with you

Be prepared!

Monday, 30 September 2013

First Assignment