CSCU9YH Development with Android

Similar documents
Introduction To Android

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

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

University of Stirling Computing Science Telecommunications Systems and Services CSCU9YH: Android Practical 1 Hello World

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

Introduction to Android

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

Introduction to Android Development

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

Mobile Application Development - Android

Android-Basics. Praktikum Mobile und Verteilte Systeme

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

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

Android Software Development Kit (Part I)

CS260 Intro to Java & Android 04.Android Intro

Understand applications and their components. activity service broadcast receiver content provider intent AndroidManifest.xml

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

SHWETANK KUMAR GUPTA Only For Education Purpose

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

application components

EMBEDDED SYSTEMS PROGRAMMING Application Basics

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

Mobile Application Development

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.

Introduction to Android

Getting started: Installing IDE and SDK. Marco Ronchetti Università degli Studi di Trento

Real-Time Embedded Systems

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

Security model. Marco Ronchetti Università degli Studi di Trento

Android Ecosystem and. Revised v4presenter. What s New

What is Android? Mobile Device Application Development COMPSCI 345

BCA 6. Question Bank

COMP4521 EMBEDDED SYSTEMS SOFTWARE

Making use of Android

Android Debugging ART

SEVEN ADVANCED ACADEMY

Mobile and Ubiquitous Computing: Android Programming (part 1)

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

Embedded Systems Programming - PA8001

Introduction to Android

Applications. Marco Ronchetti Università degli Studi di Trento

Mobile Software Development for Android - I397

ATC Android Application Development

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

ANDROID SYLLABUS. Advanced Android

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

IJRDTM Kailash ISBN No Vol.17 Issue

ANDROID TRAINING PROGRAM COURSE CONTENT

Mobile Programming Lecture 1. Getting Started

ANDROID DEVELOPMENT. Course Details

Syllabus- Java + Android. Java Fundamentals

Android App Development Workshop

Android Development Tutorial. Yi Huang

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

App Development for Android. Prabhaker Matet

Android App Development

Computer Science E-76 Building Mobile Applications

SD Module- Android Programming

Android Application Development Course Code: AND-401 Version 7 Duration: 05 days

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

Android Development Tools = Eclipse + ADT + SDK

Java & Android. Java Fundamentals. Madis Pink 2016 Tartu

ORACLE UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

Introduction to Android development

What is Android? Android is an open-source operating system (OS) used in smart devices

Programming Android UI. J. Serrat Software Design December 2017

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

Android Fundamentals - Part 1

Android In Industrial Applications. A Field Report

IEMS 5722 Mobile Network Programming and Distributed Server Architecture

User Guide For Android Ice Cream. Sandwich Tablet >>>CLICK HERE<<<

Minds-on: Android. Session 1

Lecture 08. Android Permissions Demystified. Adrienne Porter Felt, Erika Chin, Steve Hanna, Dawn Song, David Wagner. Operating Systems Practical

Android Essentials with Java

UNIT:2 Introduction to Android

Now SMS/MMS Android Modem Quick Start Guide

COURSE SYLLABUS ANDROID. Industrial Training (4 MONTHS) PH : , Vazhoor Road Changanacherry-01.

COSC 3P97 Mobile Computing

M O B I L E T R A I N I N G. Beginning Your Android Programming Journey

Android Application Development

Android App Development

Course Learning Outcomes (CLO): Student Outcomes (SO):

Lecture 2 Android SDK

Android Overview. Francesco Mercaldo, PhD

Activities. Repo:

LECTURE 12 BROADCAST RECEIVERS

Xin Pan. CSCI Fall

MARS AREA SCHOOL DISTRICT Curriculum TECHNOLOGY EDUCATION

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

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

Q.1 Explain the dialog and also explain the Demonstrate working dialog in android.

Multiple Activities. Many apps have multiple activities

Group B: Assignment No 8. Title of Assignment: To verify the operating system name and version of Mobile devices.

ios vs Android By: Group 2

Manual For Android Jelly Bean Features Vs Ice

Android. (XKE Mars 2009) Erwan Alliaume.

Mobile Computing. Introduction to Android

EMBEDDED SYSTEMS PROGRAMMING Android NDK

Programming in Android. Nick Bopp

A Customizable Travel Application- Travel-It

Transcription:

CSCU9YH Development with Android Computing Science and Mathematics University of Stirling 1 Android Context 3

Smartphone Market share Source: http://www.idc.com/promo/smartphone-market-share/os 4 Smartphone Penetration by Country 5

Pros and Cons of Android Good: Open source (Apache licence) Familiar developer languages Developer/distribution friendly Carrier independence Open Handset Alliance Not so Good: Version incompatibilities Inconsistent experiences Only Java-like syntax, not identical APIs 6 Android Information Many textbooks, e.g.: Hello, Android, E. Burnette Professional Android Application Development, R. Meier Good online sources, e.g.: http://www.android.com http://developer.android.com Versions named after sweet things, e.g.: Froyo (2.2), Gingerbread (2.3) Honeycomb (3.0) Ice Cream Sandwich (4.0) Jelly Bean (4.1-4.3), Kitkat (4.4) Lollipop (5.0) Data collected during a 7-day period ending on 4 th January 2016. 7 http://developer.android.com/about/dashboards/index.html

. A more recent update Data collected during a 7-day period ending on 9 th January 2017. Source: http://developer.android.com/about/dashboards/index.html 8 just for reference Version Codename API Distribution 2.3.3-2.3.7 4.0.3-4.0.4 4.1.x Gingerbread 10 1.0% Ice Cream Sandwich 15 1.1% 16 4.0% Jelly Bean 4.2.x 17 5.9% 4.3 18 1.7% 4.4 KitKat 19 22.6% 5.0 21 10.1% Lollipop 5.1 22 23.3% 6.0 Marshmallow 23 29.6% 7.0 Nougat 24 0.5% http://developer.android.com/about/dashboards/index.html Accessed 13 th Jan 2017 9

Android Architecture Or ART http://developer.android.com/about/versions/index.htm 10 Dalvik Virtual Machine Register-based (most VMs are stack-based): Java is stack-based, Android is register-based Optimised for low memory environments: trimmed to occupy and use less space no Just In Time compiler until version 2.2 has its own bytecode, i.e. Dalvikis not a Java VM aims to be efficient on small devices Infinite registers, fewer instructions (30%), smaller code 11

Android Runtime Successor to Dalvik JIT vs AOT compilation ART Virtual Machine At installation time compiles dex files using an on device compiler Main improvements Ahead-of-time (AOT) compilation Improved garbage collection Development and debugging improvements 12 Application Architecture Each app (application) runs in its own process: each process has its own VM, hence the optimisations Libraries are written in C/C++: exposed to apps via wrappers Application components: Activities Services Broadcast Receivers Content Providers Intents Resources http://markfaction.wordpress.com/2012/07/15 /stack-based-vs-register-based-virtualmachine-architecture-and-the-dalvik-vm/ 13

Application Architecture 14 Activities Each visual interface is an activity: one application may have many activities each is a subclass of the Activity class generally there is a starting activity one activity may start/launch another activity 15

States of An Activity Active/running: a foreground activity is the focus of input top of the activity stack Paused (killable): activity has lost focus but is still available to the user still alive, retains all state, tied to window manager Stopped (killable): when completely obscured from the user retains state unless killed 16 Activities and Views Activities have a default drawing area: typically fills the screen, but may not additional windows permitted, also pop-ups ( toasts ) and dialogue boxes May subdivide screen into fragments (since Android 3); helps different screen sizes but is not covered here visual spaces constructing using Views Views are visual building blocks like widgets: buttons, text fields, scroll bars, etc. placed in a window with the Activity.setContentView method 17

Services Extend the Service base class No visual representation Services run in the background: for an indefinite amount of time generally in their own threads (within processes) Typical examples: music playback background download 18 Broadcast Receivers Extend the BroadcastReceiver class A single function receives and reacts to broadcast announcements, e.g.: time zone change low battery an incoming message No user interface, but may launch an activity or notification: notifications may be via vibration, chime, etc. Broadcasts may be initiated by apps: sendbroadcast() 19

Content Providers Make app data available to others Flexible storage through a relational database (SQLite) The Contacts app is a good database example: but beyond the scope of this module 20 Intents and Intent Filters An Intent is a message like an event passed among components: one component that wants to invoke another simply expresses its intent to have a job performed A component claims that it can do such a job through an IntentFilter An Intent is handled by Android to perform a job A PendingIntent is an intent delegated to another app, typically in response to a future event 21

Uniqueness of Intent Model Intents resemble parameter passing in APIs Consider the differences: API calls are synchronous but intent-based invocation is asynchronous (mostly) API calls are bound at compile time but intent-based calls are bound at run time (mostly) Intents are thus more like events: components do not need to be aware of each other 22 Resources Apps can have many kinds of resources such as: values (strings, numbers, colours, ) styles and themes drawables (images) views layouts Resources are stored in the app res folder Resources can be varied according to the context: different languages (values-en, values-fr, ) different screen sizes (layout-small, layout-medium, ) different screen dots/inch (layout-ldpi, layout-mdpi, ) 23

Defining and Using Resources Resources can be defined using XML, but are better defined directly in an IDE (e.g. Android Studio) Resources are accessed in code using the R class (created in the app gen folder): this is automatically generated by the IDE it names integer constants to identify resources setcontentview(r.layout.main); Button go = (Button) findviewbyid(r.id.go); Resources resources = getresources(); String name = resources.getstring(r.string.appname); Drawable icon = resources.getdrawable(r.drawable.appicon); 24 package uk.ac.stir.cs.android.hello; import android.app.activity; import android.os.bundle; import android.widget.textview; Hello Android public class HelloActivity extends Activity { @Override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); TextView textview = new TextView(this); textview.settext("hello Android"); setcontentview(textview); } } http://www.mkyong.com/android/android-hello-world-example/ 25