Multimedia programming Einopekka Laurikainen Joonas Laurikainen
!! The
Android platform is a software stack for mobile devices including an operating system, middleware and key applications. !! Developers can create applications for the platform using the Android SDK.
!! Applications are written using the Java programming language and run on Dalvik, a custom virtual machine designed for embedded use, which runs on top of a Linux kernel.
!! !! !! !!
!! !! !! !! !! !!
Application framework enabling reuse and replacement of components Dalvik virtual machine optimized for mobile devices Integrated browser based on the open source WebKit engine Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional) SQLite for structured data storage Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF) GSM Telephony (hardware dependent) Bluetooth, EDGE, 3G, and WiFi (hardware dependent) Camera, GPS, compass, and accelerometer (hardware dependent) Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE
Home, Browser, Contacts... Window manager, Package manager... Webkit, SQLite, OpenGL | ES, SSL, libc... Drivers: WiFi, Camera, Display...
The default behavior of an Android application is to operate within its own container on objects it owns. This behavior can be modified in two ways: 1)! Share application space with another application 2)! Share application components with other applications and the system These exceptions are made through the application manifest file.
Basic building blocks of an application: !! Views !! Content Providers !! Resource Managers !! Notification Managers !! Activity Managers Designed with reuse in mind
Divided into three parts Libraries Galvik virtual machine Core libraries
Libc OpenCORE Surface manager
•!C system library •!PacketVideo's media libraries •!Display subsystem and 2D/3D management library
LibWebCore
•!Web browser engine
SGL
•!2D graphics engine
OpenGL ES 1.0 API FreeType SQLite
•!3D libraries •!Bitmap and vector font rendering •!Lightweight relational database
•!Non-standard Java virtual machine. •!Not Java SE (used for application development though) •!Not Java ME •!No Swing/AWT windowing toolkits Google’s inhouse version •!Based on some of Java SE packages •!Apache commons •!Httpclient •!Junit
Android.* packages •!Telephony APIs •!power management •!SMS
Android’s programs are written in Java, using Java-oriented IDEs. It just doesn’t compile the java code into java bytecode but instead Dalvik bytecode (.dex) Every application has its own instance of the Dalvik virtual machine
!! Relies
on the Linux kernel for underlying functionality !! Threading !! Low-level memory management.
!! Core
libraries basically inherited from java core libraries !! java.io.* !! java.util.* !! Java.net.* !! Java.math.*
!! Handles
the physical hardware !! Ships with version 2.6.x Linux !! Linux manages variety of services !! Security !! memory management !! process management !! Networking !! drivers for a variety of devices
!! Best
support for developing programs for Android is to do it through Eclipse. !! Eclipse IDE version 3.2 or newer !! JDK 5 or 6 !! Android SDK
!! You
also may want to install the Android Development Tools Plugin (ADT). ADT automates a lot of what you would have to do manually in order to develop Android applications.
Android.graphics
•!Provides low level graphics tools such as canvases, color filters, points, and rectangles that let you handle drawing to the screen directly
Android.database
•!Contains classes to manipulate data returned from content providers
Android.hardware
•!Provides support for hardware devices that may not be present on every Android device.
Android.telephony
•!Monitoring the basic phone information, such as the network type and connection state, utilities for manipulating phone number strings.
Android.view Android.Webkit Android.Os Android.Widget
•!Handle screen layout and interaction with the user •!Provides tools for browsing the web. •!Basic operating system services, message passing, and inter-process communication on the device •!contains (mostly visual) UI elements to use on your Application screen.
Optional (might not be fully supported by device)
Android.net.WiFi
•!Technical infos, IP-address and support standarts
Android.location
•!GPS •!Cellular positioning
Android.Media Android.opengl
•!Music & video codecs •!Stream receiving over IP •!Uses hardware if avaivable •!Software if no hardware support
package com.android.hello; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = new TextView(this); tv.setText("Hello, Android"); setContentView(tv); } }
!! Google’s
application store, where users can search, download, buy and install software !! Android Market allows developers to offer applications to people with Android based smartphones.
!! 27.10.2008 opened for developers to upload free software ($25 one time application fee) !! Q1 2009 developers can distribute paid apps (developers get 70% of the revenue from each purchase, remaining part goes to carriers and billing settlement fees)
!! Users
can provide feedback to the developer and even rate the application in a way that Google says is similar to how YouTube works. !! For developers, the process is also YouTubelike: register, upload, and publish. The Android Market interface will provide developers with dashboard view of their account that will eventually include analytic data about how their apps are doing.
!! First
Android smartphone. !! Features include touch screen, real web browser, 3 Megapixel camera, QWERTY keyboard, Google Maps, Calendar, Youtube, Gmail, Google Talk, music and video playback, 3G with WiFi.
!!1.
Domo Arigato Mr Androidato—An Introduction to the New Google Mobile Linux Framework, Android Adam M. Dutko. 2008. Linux Journal http://delivery.acm.org/ 10.1145/1380000/1371251/9961.html? key1=1371251&key2=4038993221&coll=ACM&dl=ACM&CFID=6242205&CFTOK EN=68420541 !!2. Android - An Open Handset Alliance Project – http://code.google.com/android/what-is-android.html !!3. Dalvik - Google's tweaked, non-standard JVM for Android- http:// www.oreillynet.com/onjava/blog/2007/11/dalvik_googles_tweaked_nonstan.html !!4. Design and development of an everyday hand gesture interface Zoltán Prekopcsák, Péter Halácsy, Csaba Gáspár-Papanek. 2008. http://delivery.acm.org/ 10.1145/1410000/1409318/p479-prekopcsak.pdf? key1=1409318&key2=2221004221&coll=ACM&dl=ACM&CFID=6242205&CFTOK EN=68420541 !!5. An activity-driven model for context-awareness in mobile computing Hong-Siang Teo 2008 http://delivery.acm.org/10.1145/1410000/1409342/p545-teo.pdf? key1=1409342&key2=5831004221&coll=ACM&dl=ACM&CFID=6242205&CFTOK EN=68420541 !!6. T-Mobile G1 homepage http://www.t-mobileg1.com/g1-learn-features-details.aspx