Android Geek Night. Application framework

Similar documents
Introduction to Android

Programming with Android

Android Programming and Security

Hacking your Droid ADITYA GUPTA

Introduction to Android Development. Jeff Avery CS349, Mar 2013

Graduate presentation for CSCI By Janakiram Vantipalli ( Janakiram.vantipalli@colorado.edu )

Android Development. Marc Mc Loughlin

Smartphone market share

Introduction to Android Programming (CS5248 Fall 2015)

Android Fundamentals 1

ANDROID BASED MOBILE APPLICATION DEVELOPMENT and its SECURITY

Running a Program on an AVD

Технологии Java. Android: Введение. Кузнецов Андрей Николаевич. Санкт-Петербургский Государственный Политехнический Университет

06 Team Project: Android Development Crash Course; Project Introduction

CS378 -Mobile Computing. Android Overview and Android Development Environment

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL I)

ITG Software Engineering

An Introduction to Android

How To Develop Android On Your Computer Or Tablet Or Phone

Overview. The Android operating system is like a cake consisting of various layers.

Android Framework. How to use and extend it

Here to take you beyond Mobile Application development using Android Course details

Introduction to Android. CSG250 Wireless Networks Fall, 2008

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

Android For Java Developers. Marko Gargenta Marakana

Mobile Application Development 2014

Open Source Telemedicine Android Client Development Introduction

Introduction to Android Android Architecture Software Development Purpose of the project Location Based Service (LBS) Android. Location class Google

Programming with Android: System Architecture. Dipartimento di Scienze dell Informazione Università di Bologna

Jordan Jozwiak November 13, 2011

Frameworks & Android. Programmeertechnieken, Tim Cocx

l What is Android? l Getting Started l The Emulator l Hello World l ADB l Text to Speech l Other APIs (camera, bitmap, etc)

Android Architecture. Alexandra Harrison & Jake Saxton

The "Eclipse Classic" version is recommended. Otherwise, a Java or RCP version of Eclipse is recommended.

Lecture 1 Introduction to Android

Mobile applications security Android OS (case study) Maciej Olewiński. Cryptographic Seminar r.

Specialized Android APP Development Program with Java (SAADPJ) Duration 2 months

Android 多 核 心 嵌 入 式 多 媒 體 系 統 設 計 與 實 作

Android Basics. Xin Yang

Pentesting Android Apps. Sneha Rajguru

Workshop on Android and Applications Development

Android Developer Fundamental 1

Overview of CS 282 & Android

GETTING STARTED WITH ANDROID DEVELOPMENT FOR EMBEDDED SYSTEMS

Developer's Cookbook. Building Applications with. The Android. the Android SDK. A Addison-Wesley. James Steele Nelson To

Deep Inside Android. OpenExpo Zurich September 25 th, Gilles Printemps - Senior Architect. Copyright 2007 Esmertec AG.

ANDROID PROGRAMMING - INTRODUCTION. Roberto Beraldi

Android Application Development

Introduction to Android: Hello, Android! 26 Mar 2010 CMPT166 Dr. Sean Ho Trinity Western University

Chapter 2 Getting Started

Introduction to Android

Getting started with Android and App Engine

Beginner s Android Development Tutorial!

UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Mobile Application Development Android

Module Title: Software Development A: Mobile Application Development

Lab 4 In class Hands-on Android Debugging Tutorial

Introduction to Android

App Development for Smart Devices. Lec #2: Android Tools, Building Applications, and Activities

Getting Started with Android Programming (5 days) with Android 4.3 Jelly Bean

4. The Android System

A Short Introduction to Android

OpenCV on Android Platforms

Android Application Development. Daniel Switkin Senior Software Engineer, Google Inc.

Android Application Development

Android (Basic + Advance) Application Development

Mobile Phones Operating Systems

Practical Android Projects Lucas Jordan Pieter Greyling

Programming with Android: SDK install and initial setup. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Islamic University of Gaza. Faculty of Engineering. Computer Engineering Department. Mobile Computing ECOM Eng. Wafaa Audah.

The power of root on Android emulators

Running Android Applications on BlackBerry 10 developer.blackberry.com/android

Praktikum Entwicklung Mediensysteme (für Master)

Synthesis for Developing Apps on Mobile Platforms

Android Environment Emulator

Building an Android client. Rohit Nayak Talentica Software

CSE476 Mobile Application Development. Yard. Doç. Dr. Tacha Serif Department of Computer Engineering Yeditepe University

Android Environment SDK

The Android Platform

Table of Contents. Adding Build Targets to the SDK 8 The Android Developer Tools (ADT) Plug-in for Eclipse 9

Example of Standard API

Performance Analysis of Android Platform

Appium mobile test automation

CS 403X Mobile and Ubiquitous Computing Lecture 6: Maps, Sensors, Widget Catalog and Presentations Emmanuel Agu

Reminders. Lab opens from today. Many students want to use the extra I/O pins on

An Introduction to Android. Huang Xuguang Database Lab. Inha University

Android Application Development - Exam Sample

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

TUTORIALS AND QUIZ ANDROID APPLICATION SANDEEP REDDY PAKKER. B. Tech in Aurora's Engineering College, 2013 A REPORT

ANDROID. Programming basics

INTRODUCTION TO ANDROID CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 11 02/15/2011

Android Programming: Installation, Setup, and Getting Started

Android Development. Lecture AD 0 Android SDK & Development Environment. Università degli Studi di Parma. Mobile Application Development

Introduction (Apps and the Android platform)

BogDan Vatra and Andy Gryc. Qt on Android: Is it right for you?

Transcription:

Android Geek Night Application framework

Agenda 1. Presentation 1. Trifork 2. JAOO 2010 2. Google Android headlines 3. Introduction to an Android application 4. New project using ADT 5. Main building blocks of an application Activities, Services, Broadcast, Intent, Content Providers 6. Tools 7. Interfacing with sensors, GPS and SD card 8. QA 9. Recordbeater by Ole 10. Sandwich

Google Android Operating system targeting mobile devices Linux based - with additions Open source under the Apache License Allows development in Java Or Scala, JRuby, Groovy.. Share of 2010 Q2 smartphone sales to end users by operating system, according to Gartner.

Dalvik Virtual Machine Virtual machine developed by Google for mobile devices Uses the Dalvik Executable (.dex) format Designed for limited processing power and memory Register-based architecture as opposed to stack machine Java VMs JIT from 2.2 Class library based on Apache Harmony No AWT, Swing No Java MEDisplay data, handle user input, launch other activities

Architecture

Main Building Blocks

Activities Display data, handle user input, launch other activities An Activity is for an Android Application like a webpage for a webapp. Correspond (you might say) to a UI screen.

Activity Lifecycle

Views Activity UI is build using hierarchy of Views View is (mostly) defined in XML layout files Can be defined in code as well.. Components Layouts and UI Components Example HorizontalLayout, Button

Intent Intent objects are asynchronous messages used to activate Activities, Services and BroadcastReceivers Intent can be explicit (Give the class that you want started, Android OS will start) startactivity(new Intent(getApplicationContext(),MyActivity.class));

Intent 2 Intent can be implicit The Android OS resolved the action using IntentFilter (more on this later) Intent consist of a Action and Data (Implicit) Intent therefore says: "Do this" Intent.Action on "That" Intent.Data This is nice.. then we can do something like! Uri number = Uri.parse("tel:24234232"); Intent dial = new Intent(Intent.ACTION_DIAL, number); startactivity(dial);

Intent Filter Intent is matched against IntentFilters. Specified in the AndroidManifest.xml (*) Can contain the following elements. <action android:name="..." /> <data android:mimetype="..." /> <category android:name="..." /> * The one exception would be filters for broadcast receivers that are registered dynamically by calling Context.registerReceiver(); they are directly created as IntentFilter objects.)

Intent Resolution Done by the Android OS Find the 'Best' component to activated from an Intent Native Android application components are part of the Intent resolution process in exactly the same way as third-party applications. My Little sample app. Country List My Jaoo conference (More than one app can respond to intent)

Service An activity without a UI Should be defined in the manifest Can run as a background process Start by either startservice bindservice Remember it runs in the main thread...

Service Lifecycle

Broadcast Receivers Receive system wide event broadcast Defined in the manifest.xml (as well) No user interface But may start an activity, play sound, show notification, start a service. Examples receives and reacts to broadcast announcements SMS received Timezone changed Battery low User setting changes

Content Providers Access through ContentResolver Content is record based Access data accross process boundaries Should be implemented thread save Example of builtin. Contact, Mediastore

Security and Permissions Applications... must be signed... run in their own sandbox No application has (default) permission to perform changes that will impact other applications. Declared statically and known at install time. Therefore you can not change after install Example use permissions: <uses-permission android:name="android.permission.receive_sms" /> You can declare you own permissions. <permission android:name="com.me.myapp.permission.deadly_activity" android:label="@string/permlab_deadlyactivity" android:description="@string/permdesc_deadlyactivity" android:permissiongroup="android.permission-group.cost_money" android:protectionlevel="dangerous" />

Android Tools Virtual Devices Debugging & profiling GUI Build & packaging... a lot of this is available from ADT

Android SDK and AVD Manager $ android

Build & Packaging dx.class bytecode -> Android bytecode apkbuilder package Android application zipalign align data in apk for more efficient mem mapping

GUI hierarchyviewer Inspect View hierarchy, magnifier (pixel level) draw9patch NinePatch images (e.g. for background imgs) layoutopt detect inefficiencies and other problems in layout

Android Debug Bridge logcat Install, pull, push jdwp port forwarding shell

Debugging Cont'd ddms - Dalvik Debug Monitor Server threads logcat fileviewer traceview trace log viewer

sqlite3 Simple but powerful, one-file-based relational database Can be accessed with sqlite3 tool from shell

Android with ant Generated ant build file Uses SDK tools to compile, debug and run $ android create project target...

Android & Maven No official repository Deploy in your own repo or install locally Uses android.jar and command line tools Modules & libraries works as in any other maven project maven-android-plugin

Android Hardware How to interface to special hardware present on most Android devices Various sensors GPS SD card and considerations regarding one piece of hardware present on all mobile devices...

Android Hardware Android is build on top of the Linux kernel which is responsible for traditional OS stuff: Hardware drivers WIFI, sensors, telephony, display,... Process management Memory management Different hardware vendors will provide drivers for their specific hardware

Android Hardware Writing software to interface with the hardware of an Android device a funny and challenging task. Many applications need only to worry about one single piece of hardware...

Android Hardware THE BATTERY YOU SHOULD WORRY TOO!

Android Hardware Read the guidelines on developer.android.com http://developer.android.com/guide/practices/design/performance.html Or your application might get uninstalled quickly!

android.hardware "Provides support for hardware devices that may not be present on every Android device." Use or SensorManager.getDefaultSensor(int type) SensorManager.getSensorList(int type) to look for sensors of a specific type.

Sensors The following sensors are defined in Sensor: TYPE_ACCELEROMETER TYPE_GYROSCOPE TYPE_LIGHT TYPE_MAGNETIC_FIELD TYPE_ORIENTATION TYPE_PRESSURE TYPE_PROXIMITY TYPE_TEMPERATURE The highlighted ones are present on my Nexus One

Sensors All sensors are monitored using the same API. The example application shows the sensors found, and let the user select the one to watch. <Example app: Senfo>

Location Providers Access to location providers goes through the android.location.locationmanager Choose between the following types: GPS_PROVIDER NETWORK_PROVIDER PASSIVE_PROVIDER

Location Providers <Example app: GetMeThere>

android.os.environment import android.os.environment; File root = getexternalstoragedirectory (); Using external storage, you may need to listen for ACTION_MEDIA_ broadcast intents: ACTION_MEDIA_UNMOUNTED ACTION_MEDIA_MOUNTED ACTION_MEDIA_* and check the state with getexternalstoragestate()

Q & A