Android
Nathan Freitas, Oliver+Coady nathan@olivercoady.com
Android Platform Basics
Platform Features
• 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
What’s in an App?
Libraries Default Activity Other Other Other Activities Activities Activities Android Manifest Drawable Layouts Values Assets Service Content
Manifest
Layout
Activity /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.reportform); ((Button)findViewById(R.id.btnReportFormSubmit)).setOnClickListener(this); ((Button)findViewById(R.id.btnReportFormCancel)).setOnClickListener(this);
package com.openideals.inaugreport; import import import import import import import import import import import import import import import android.app.Activity; android.app.ProgressDialog; android.content.Intent; android.location.Location; android.os.Bundle; android.os.Handler; android.util.Log; android.view.View; android.view.View.OnClickListener;