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

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

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

Android App Development. Muhammad Sharjeel COMSATS Institute of Information Technology, Lahore

Android App Development

Introduction To Android

CS260 Intro to Java & Android 04.Android Intro

Android Development Tutorial. Yi Huang

Android. Operating System and Architecture. Android. Screens. Main features

Android App Development. Ahmad Tayeb

Android Overview. Francesco Mercaldo, PhD

IJRDTM Kailash ISBN No Vol.17 Issue

Mobile OS. Symbian. BlackBerry. ios. Window mobile. Android

Mobile Computing. Introduction to Android

Introduction to Android Android Smartphone Programming. Outline University of Freiburg. What is Android? Background University of Freiburg.

Programming with Android: Android for Tablets. Dipartimento di Scienze dell Informazione Università di Bologna

SD Module- Android Programming

UNIT:2 Introduction to Android

Introduction to Android

Introduction to Android

Android Ecosystem and. Revised v4presenter. What s New

BCA 6. Question Bank

Android for Ubiquitous Computing Researchers. Andrew Rice University of Cambridge 17-Sep-2011

CSCU9YH Development with Android

Ahmed Ali Big fan of Android

Android Development Tools = Eclipse + ADT + SDK

Android Programming (5 Days)

Android Overview. Most of the material in this section comes from

Another difference is that the kernel includes only the suspend to memory mechanism, and not the suspend to hard disk, which is used on PCs.

Android In Industrial Applications. A Field Report

Android Basics. - Bhaumik Shukla Android Application STEALTH FLASH

PAPER ON ANDROID ESWAR COLLEGE OF ENGINEERING SUBMITTED BY:

Introduction. Lecture 1. Operating Systems Practical. 5 October 2016

Android OS. Operating System based on Linux [ ] [Jonas Teuscher, Alex Cuordileone, Cédric Glaus]

Why Android? Why Android? Android Overview. Why Mobile App Development? 20-Nov-18

Programming with Android: Intents. Luca Bedogni. Dipartimento di Scienze dell Informazione Università di Bologna

Started with Android Programming for Tablets

MC Android Programming

International Journal of Multidisciplinary Consortium Volume 2 Issue

Gauthier Picard. Ecole Nationale Supérieure des Mines

Lecture 1 - Introduction to Android

DROID. By S.Gokulakrishnan AP/CSE SCSVMV

Produced by. Mobile Application Development. David Drohan Department of Computing & Mathematics Waterford Institute of Technology

Android. (XKE Mars 2009) Erwan Alliaume.

What is Android? Mobile Device Application Development COMPSCI 345

Android Online Training

Android System Architecture. Android Application Fundamentals. Applications in Android. Apps in the Android OS. Program Model 8/31/2015

Introduction to Android Application Development. Mike Kvintus Principal Engineer JDSU

Android. Lesson 1. Introduction. Android Developer Fundamentals. Android Developer Fundamentals. to Android 1

COPYRIGHTED MATERIAL. 1Getting Started with Android Programming

1. What are the key components of Android Architecture? 2. What are the advantages of having an emulator within the Android environment?

Mobile development initiation

Android Internals and the Dalvik VM!

Android User Interface Android Smartphone Programming. Outline University of Freiburg

COLLEGE OF ENGINEERING, NASHIK-4

Android User Interface

ANDROID SYLLABUS. Advanced Android

Developer s overview of the Android platform

Fragments were added to the Android API in Honeycomb, API 11. The primary classes related to fragments are: android.app.fragment

Android Application Development

Software Development & Education Center ANDROID. Application Development

Open Mobile Platforms. EE 392I, Lecture-6 May 4 th, 2010

Programming with Android: Activities and Intents. Dipartimento di Informatica Scienza e Ingegneria Università di Bologna

Android. Michael Greifeneder. Image source: Android homepage

Lecture 1 Introduction to Android. App Development for Mobile Devices. App Development for Mobile Devices. Announcement.

Chapter 1 Hello, Android

Android Training Overview (For Demo Classes Call Us )

Praktikum Mobile und Verteilte Systeme. Android-Basics. Prof. Dr. Claudia Linnhoff-Popien André Ebert, Sebastian Feld

Android Application Development Course 28 Contact Hours

Mobile and Wireless Systems Programming

Android-Basics. Praktikum Mobile und Verteilte Systeme. Prof. Dr. Claudia Linnhoff-Popien André Ebert, Sebastian Feld

INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

ios vs Android By: Group 2

Android Programming in Bluetooth Cochlea Group

Android App Development

Mobile Forensics: Android Platforms and WhatsApp Extraction Tools

Mobile Application Development

SHWETANK KUMAR GUPTA Only For Education Purpose

Introduction to Android

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology

ITG Software Engineering

Programming with Android: Application Resources. Dipartimento di Scienze dell Informazione Università di Bologna

MOBILE APPLICATION AND INTERFACE FOR A SMART CARD READER

Android App Development Workshop

Mobile Computing LECTURE # 2

Android. Mobile operating system developed by Google A complete stack. Based on the Linux kernel Open source under the Apache 2 license

Minds-on: Android. Session 1

INDEX. CHAPTER Android Introduction

An Introduction to Android. Jason Chen Developer Advocate Google I/O 2008

IJSRD - International Journal for Scientific Research & Development Vol. 3, Issue 12, 2016 ISSN (online):

IGEEKS TECHNOLOGIES. Software Training Division. Academic Live Projects For BE,ME,MCA,BCA and PHD Students

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

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Language-Based Security on Android (call for participation) Avik Chaudhuri

Android Software Development Kit (Part I)

COSC 3P97 Mobile Computing

Mobile and Ubiquitous Computing: Android Programming (part 1)

Android. Training.

Introduction to Android development

A COLLEGE ANDROID MOBILE APPLICATION

Course Syllabus. Course Title. Who should attend? Course Description. Android ( Level 1 )

Transcription:

Programming with Android: System Architecture Luca Bedogni Marco Di Felice Dipartimento di Scienze dell Informazione Università di Bologna

Outline Android Architecture: An Overview Android Dalvik Java Virtual Machine Android Components: Activities Android Components: Intents Android Components: Services Android Components: Content Providers Android Application Distribution and Markets Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 2

Android What? v Android is a Linux-based platform for mobile devices Operating System Middleware Applications Software Development Kit (SDK) v Which kind of mobile devices (examples) SMARTPHONES TABLETS EREADERS Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 3

Android When? 2005 2006 2007 2008 2009 Time Ø Google buys Android from the Android Inch Ø Open Handset Alliance (OHA) created for open standards for mobile devices. Partners of OHA: Google, Motorola, Samsung, Vodafone, T-Mobile, etc Ø Android 1.0 Released Ø The first Android smartphone: G1 HTC-Dream Ø Android 1.1 Released Ø Android 1.5 (CupCake) Released Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 4

Android When? 2008 2009 2010 2011 2012 Time Ø Android 1.6 (Donut) Released Ø Android 2.0 (Eclair) Released Ø Android 2.2 (Froyo) Released Ø Android 2.3 (Gingerbread) Released Ø Android 3.0 (Honeycomb) Released (First version for devices with larger screens such as tablets) Ø Android 4.0 (Ice-Cream Sandwich) Released. (It merges the 3.x tab centric design and the v2.x phone based design into a single version.) Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 5

Android When? ANDROID DISTRIBUTIONS ANDROID APPLICATIONS http://www.email-marketing-reports.com/wireless-mobile/smartphone-statistics.htm http://www.appbrain.com/stats/android-market-app-categories Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 6

The Android Architecture } Stack Architecture Open Source Architecture (Apache/MIT License v. 2.0) Business-friendly License Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 7

The Android Architecture Built on top of Linux kernel (v. 2.6-3.0) Advantages: Ø Portability (i.e. easy to compile on different harwdare architectures) Ø Security (e.g. secure multi-process environment) Ø Power Management Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 8

The Android Architecture Native Libraries (C/C++ code) Ø Graphics (Surface Manager) Ø Multimedia (Media Framework) Ø Database DBMS (SQLite) Ø Font Management (FreeType) Ø WebKit Ø C libraries (Bionic) Ø. Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 9

The Android Architecture Application Libraries (Core Components of Android) Ø Activity Manager Ø Packet Manager Ø Telephony Manager Ø Location Manager Ø Contents Provide Ø Notification Manager Ø. Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 10

The Android Architecture Applications (Written in Java code) Ø Android Market Ø Entertainment Ø Productivity Ø Personalization Ø Education Ø Geo-communication Ø. Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 11

The Android Architecture Dalvik Virtual Machine (VM) Ø Novel Java Virtual Machine implementation (not using the Sun JVM) Ø Open License (Sun JVM is not open!) Ø Optimized for memoryconstrained devices Ø Faster than Sun JVM Ø. Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 12

Dalvik Java Virtual Machine (JVM) Java Source Code Java Compiler Java Standard Edition Java Source Code Java Compiler Java Byte Code Java Byte Code Java Virtual Machine (JVM) Stack-based byte-code Dalvik Byte Code Dalvik Virtual Machine (VM) Dex Compiler Register-based byte-code Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 13

Android Applications Design APPLICATION DESIGN: Ø GUI Definition Ø Events Management Ø Application Data Management Ø Background Operations Ø User Notifications Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 14

Android Components: Activities Ø An Activity corresponds to a single screen of the Application. Android HelloWorld Button1 Hello World! Ø An Application can be composed of multiples screens (Activities). Ø The Home Activity is shown when the user launches an application. Ø Different activities can exhange information one with each other. Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 15

Android Components: Activities Ø The Activity Manager is responsible for creating, destroying, managing activities. Ø Activities can be on different states: starting, running, stopped, destroyed, paused. Ø Only one activity can be on the running state at a time. Ø Activities are organized on a stack, and have an event-driven life cycle (details later ) Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 16

Android Components: Activities Ø Each activity is composed by a list of graphics components. Ø Some of these components (also called Views) can interact with the user by handling events (e.g. Buttons). Ø Two ways to build the graphic interface: PROGRAMMATIC APPROACH Example: Button button=new Button (this); TextView text= new TextView(); text.settext( Hello world ); Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 17

Android Components: Activities Ø Each activity is composed by a list of graphics components. Ø Some of these components (also called Views) can interact with the user by handling events (e.g. Buttons). Ø Two ways to build the graphic interface: DECLARATIVE APPROACH Example: < TextView android.text=@string/hello android:textcolor=@color/blue android:layout_width= fill_parent android:layout_height= wrap_content /> < Button android.id= @+id/button01 android:textcolor= @color/blue android:layout_width= fill_parent android:layout_height= wrap_content /> Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 18

Android Components: Activities Ø Android applications typically use both the approaches! DECLARATIVE APPROACH XML Code Define the Application layouts and resources used by the Application (e.g. labels). PROGRAMMATIC APPROACH Java Code Manages the events, and handles the interaction with the user. Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 19

Android Components: Intents Ø Intents: asynchronous messages to activate core Android components (e.g. Activities). Ø Explicit Intent à The component (e.g. Activity1) specifies the destination of the intent (e.g. Activity 2). LOGIN marco Welcome Marco! Activity1 PASSWORD ********** Login Login Intent Activity2 Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 20

Android Components: Intents Ø Intents: asynchronous messages to activate core Android components (e.g. Activities). Ø Implicit Intent à The component (e.g. Activity1) specifies the type of the intent (e.g. View a video ). Activity1 View Multiple choices might be available to the user! Implicit Intent Activity2 Activity2 } Intent- Filters Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 21

Android Components: Services Ø Services: like Activities, but run in background and do not provide an user interface. Ø Used for non-interactive tasks (e.g. networking). Ø Service life-time composed of 3 states: Starting Destroyed oncreate() onstart() ondestroy() Running (on background) Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 22

Android Components: Content Providers Ø Each Android application has its own private set of data (managed through files or through SQLite database). Ø Content Providers: Standard interface to access and share data among different applications. insert() APP update() delete() Content Provider DB query() e.g. Photo Gallery Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 23

Android Components: Broadcast Receivers Ø Publish/Subscribe paradigm Ø Broadcast Receivers: An application can be signaled of external events. Ø Notification types: Call incoming, SMS delivery, Wifi network detected, etc Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 24

Android Application Distribution APK FILE XML Files C Ø Each Android application is contained on a single APK file. Ø Java Byte-code (compiled for Dalvik JVM) Ø Resources (e.g. images. videos, XML layout files) Ø Libraries (optimal native C/C++ code) Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 25

Android Application Distribution Ø Each application must be signed through a key before being distributed. Ø Applications can be distributed via Web or via Markets. Ø Android Market: application store run by Google but several other application stores are available (they are just normal applications). Luca Bedogni, Marco Di Felice - Programming with Android System Architecture 26