Real Time System Project 1 Understand and Build Android Programming Environment Advisor: Prof. Tei-Wei i Kuo Presented by: Che-Wei Chang
Outline Introduction to Android Framework What is Android Android Framework Analysis Energy Saving over Android Platform Dynamic Power Management Dynamic Voltage Scaling Instructions to Install Android Tool Chain Step by Step Installation Configuration of Android Software Development Kit Project Requirements Report Format Submission Rules 2
Introduction to Android An Open Software Platform for Mobile Development An Open Handset Alliance Project Based on the Linux Kernel Fast Application Development in Java Ranked First Among All Smartphone OS Handsets Sold in the U.S. in the Second Quarter of 2010, at 33% 3 http://en.wikipedia.org/wiki/android_(operating_system)
4 Android Framework
Linux Kernel and Libraries The Linux Kernel Work as the Hardware Abstraction Layer (HAL) Provide hardware device drivers Provide the essential operating system functionality Android Libraries Include multimedia framework Handle GUI windows Provide light-weight programming libraries Support 2D and 3D graphics 5 http://en.wikipedia.org/wiki/dalvik_(software)
Android Runtime and Application Framework Dalvik Virtual Machine and Core Libraries Android applications are converted into the compact Dalvik Executable DVM is designed d to be suitable for systems that are constrained in terms of memory and processor speed The VM was slimmed down to use less space Application Framework Provide API interface Manage application lifecycle 6
Outline Introduction to Android Framework What is Android Android Framework Analysis Energy Saving over Android Platform Dynamic Power Management Dynamic Voltage Scaling Instructions to Install Android Tool Chain Step by Step Installation Configuration of Android Software Development Kit Project Requirements Report Format Submission Rules 7
Power Consumption of Android Platforms Real-time scheduling technology provides intelligent solutions for energy-efficient designs Provide dynamic power management for peripherals and dynamic voltage scheduling for the microprocessor in an intelligent way to prolong the lifespan of mobile devices without violation of any quality-of-service requirements. Unit: ma 8 http://rockthearth.blogspot.com/2009/04/power-consumption-of-t-mobile-g1.html
9 Power Monitor
Dynamic Power Management (DPM) Ideas Dynamically scale the power level of peripheral devices Eliminate unnecessary power dissipation with minimum performance degradationd Power level switching overheads Energy Delay Active/Standby Sleep Active Sleep Active Sleep Active Sleep Time 10
Power Model - Backlight Switch Overhead Switching every 5 seconds Level 0.05 1.00 11
Power Model 3G 3G off (air mode) 3G on (working at 24 KBps) 3G on (idle) 12
Power Model - 3G (cont.) idle to work work stable idle off to on off idle idle idle to off (5s) off 13
Dynamic Voltage Scaling (DVS) Ideas Dynamically scale down the processor frequency to fit current workloads 14
Power Model - CPU System Idle Level Frequency 1 19.2MHz 2 122.88MHz 40mA ~ 60mA 3 128MHz 4 245.76MHz 5 384MHz 6 528MHz 15
Power Model CPU (cont.) 100mA ~ 155mA System runs with a busy thread. Level Current (ma) 1 100 ~ 112 2 100 ~ 112 3 125 112mA ~ 155mA 4 135 5 143 6 155 16
Outline Introduction to Android Framework What is Android Android Framework Analysis Energy Saving over Android Platform Dynamic Power Management Dynamic Voltage Scaling Instructions to Install Android Tool Chain Step by Step Installation Configuration of Android Software Development Kit Project Requirements Report Format Submission Rules 17
Quick Start for Android Developers Prepare Your Development Computer Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64- bit) Mac OS X 10.5.8 or later (x86 only) Linux (tested t on Linux Ubuntu Hardy Heron) 64-bit distributions must be capable of running 32-bit applications Download and Install the SDK Starter Package Unpack the starter package to a safe location and then add the location to your PATH Install the ADT Plugin for Eclipse Set up a remote update site at https://dl-ssl.google.com/android/eclipse/ Add Android Platforms and Other Components to Your SDK Execute SDK Setup.exe 18 http://developer.android.com/sdk/index.html
Set Up Android SDK Download the SDK from: http://developer.android.com/sdk/index.html Unpack Package Set PATH Append your SDK path 19
Install Android SDK Execute SDK Manager in the root directory of Android SDK Select all packages to be installed Create virtual devices 20
Install the ADT Plugin for Eclipse Install JDK Version 6 Install Eclipse 3.5 Galileo Open Eclipse ->Help ->Install New Software -> Add Android Development Tools (ADT) by link https://dlssl.google.com/android/eclipse/ 21
Set SDK Path for Eclipse Eclipse -> Window-> Preferences 22
Open an Android Project Set SDK Path for Eclipse Restart Eclipse if it is necessary Create an Android project: New-> Project -> Android Project 23
Eclipse Setting Set the Deployment Target Selection (optional) Run-> Run Configurations-> Target -> Manual Run as-> Android Application 24
Outline Introduction to Android Framework What is Android Android Framework Analysis Energy Saving over Android Platform Dynamic Power Management Dynamic Voltage Scaling Instructions to Install Android Tool Chain Step by Step Installation Configuration of Android Software Development Kit Project Requirements Report Format Submission Rules 25
RTS Project 1 Write an Android program to show only RTS project1 by your-student-id on an Android emulator (version 1.5) Read an Android report and summary it 26
Project Requirement You should have two parts in your report Tool chain installation and coding Your step by step Your problem and solution Any other testing Your references Android survey report You can read anything thing about Android (including technique reports, news, research papers, forum articles, ) Show the major ideas of the report (it could be a table, an experimental result, an observation, ) Summary the report (with your words) within 1/3 of an A4 page 27
Bonus Install the tool chain on more than one kind of operating system (3) Implementation an Android application which play a audio file, and the audio file say RTS project1 by yourstudent-id (10) Any other interesting things (the Maximum total bonus credit is 15) 28
Submission Just the report You report should be opened by MS Office or PDF Reader The report is limited to three pages Total email size should be less than 6MB If you have any bonus, make sure TA can reproduce your result There are only Window XP 32bit, Window 7 64bit, Ubuntu 10.10 (32bit and 64bit) and Mac Snowleopard Email your project tto TA<f95093@ <f95093@csie.ntu.edu.tw> t with the email title: [RTS Project1] FullStudentID_YourName TA will reply you in one day if TA has received your submission For the delayed dl dsubmission, i deduct dd ttwo points it for each hday The deadline is two weeks later (2010/11/03 15:00) Note: when you have any question about this project Write an email to ask TA <f95093@csie.ntu.edu.tw> at any time, or Come to Room 440 during TA hours RTS TA is not a human debugger!
References Wiki: Android Wiki: Open Handset Alliance Wiki: Dalvik Android Developer: http://developer.android.com/sdk/index.html p Power Consumption Table: http://rockthearth.blogspot.com/2009/04/power- p p consumption-of-t-mobile-g1.html 30