Beruflich Dokumente
Kultur Dokumente
Announcements
HTC Tattoo Android phones for 15 teams today!
You can also borrow iPhone/iPod Touch/Android phones from me Project UI presentation on Dec 4
NTU CSIE http://mikechen.com
HTC Tattoo
Android 1.6 2.8-inch QVGA touch-screen (240x320) resolution
Project UI Presentation
Email me your slides by Thur, Dec 3, 11:59pm
Presentation:
dene main user tasks initial UI sketches 3 users feedback (with another team assigned by TA) revised UI (sketch or photoshop) related apps (iPhone and Android)
NTU CSIE http://mikechen.com
Designed to run web apps (ie. data in the cloud) Optimized for current hardware architecture
Based on Linux
Nov 28 by KT Corp
Overview
Industry news Cool app
Security Architecture
Security Architecture
No application, by default, has permission to
e.g. reading/writing users private data reading/writing another applications les access the network keeping the device awake
treated as being the same application, with the same user ID and le permission
Similar to chmod a+rw getSharedPreferences(String, int), openFileOutput(String, int) openOrCreateDatabase(String, int, ...)
NTU CSIE http://mikechen.com
Permissions
Android apps by default has no permissions
associated with it
Add one or more <uses-permission> tags to AndroidManifest.xml declaring the permissions that your application needs Otherwise, youll (often) see a security Exception
e.g.
java.lang.RuntimeException: Unable to resume activity {tw.edu.ntu/ tw.edu.ntu.Demo}: java.lang.SecurityException: Requires ACCESS_FINE_LOCATION permission
NTU CSIE http://mikechen.com
Permissions Example
<manifest xmlns:android="http://schemas.android.com/apk/res/android package="tw.edu.ntu" > <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></ uses-permission> </manifest>
Permission Checks
Permission checks with
user are done at app installation
results in SecurityException
always printed to system log
URI Permissions
Often want to grant ne-grained access
permission
e.g. email app wants to open a video attachment using another app
10min break
Audio Playback/Record
Audio/Video Playback
To play audio or video from your application,
use the MediaPlayer class.
raw resource le from the system an available network (URL)
To copy le to device:
Image Capture
Camera vs Video
Camera uses full image sensor resolution Video is typically 320x240
android.hardware.Camera
Connect/disconnect with the camera service:
set capture settings, start/stop preview, snap a picture, and retrieve frames for encoding for video.
Next 2 Weeks
Email me your UI presentation slides by Thur,
Dec 3, 11:59pm
iPhone guest speakers on Dec 11 Email me to borrow Android and iPhones Questions?
NTU CSIE http://mikechen.com