Mobile Application Development - Android

Similar documents
Mobile Application Development

Embedded Systems Programming - PA8001

Android Application Development

Real-Time Embedded Systems

CS260 Intro to Java & Android 04.Android Intro

Introduction To Android

ANDROID SERVICES, BROADCAST RECEIVER, APPLICATION RESOURCES AND PROCESS

Android Development Tutorial. Yi Huang

CSCU9YH Development with Android

Security model. Marco Ronchetti Università degli Studi di Trento

EMBEDDED SYSTEMS PROGRAMMING UI and Android

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

COMP4521 EMBEDDED SYSTEMS SOFTWARE

COSC 3P97 Mobile Computing

ANDROID APPS (NOW WITH JELLY BEANS!) Jordan Jozwiak November 11, 2012

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

Android Overview. Francesco Mercaldo, PhD

Java & Android. Java Fundamentals. Madis Pink 2016 Tartu

Developer s overview of the Android platform

CS 528 Mobile and Ubiquitous Computing Lecture 3b: Android Activity Lifecycle and Intents Emmanuel Agu

ANDROID SYLLABUS. Advanced Android

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

Introduction to Android

Lecture 2 Android SDK

IJRDTM Kailash ISBN No Vol.17 Issue

Android Software Development Kit (Part I)

Android HelloWorld - Example. Tushar B. Kute,

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

Android App Development

CS 403X Mobile and Ubiquitous Computing Lecture 3: Introduction to Android Programming Emmanuel Agu

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

The World of Android Development

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

ITG Software Engineering

BCA 6. Question Bank

Android App Development

Configuring the Android Manifest File

Android Programming Lecture 2 9/7/2011

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

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

CS378 - Mobile Computing. Anatomy of an Android App and the App Lifecycle

CMSC 436 Lab 10. App Widgets and Supporting Different Devices

Mobile and Wireless Systems Programming

UNDERSTANDING ACTIVITIES

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

Android Application Development 101. Jason Chen Google I/O 2008

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

ECOM 5341 Mobile Computing(Android) Eng.Ruba A. Salamah

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

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

Around Android. Essential Android features illustrated by a walk through a practical example

Android Application Development. By : Shibaji Debnath

Computer Science E-76 Building Mobile Applications

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

Applications. Marco Ronchetti Università degli Studi di Trento

Lab 1: Getting Started With Android Programming

Mobile Application Development

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

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

Questions and Answers. Q.1) Which of the following is the most ^aeuroeresource hungry ^aeuroepart of dealing with activities on android?

Lecture 1 - Introduction to Android

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

EMBEDDED SYSTEMS PROGRAMMING Application Basics

Programming Concepts and Skills. Creating an Android Project

Mobile Application Development Android

Wirtschaftsinformatik Skiseminar ao. Prof. Dr. Rony G. Flatscher. Seminar paper presentation Dennis Robert Stöhr

Introduction to Android development

Android-Basics. Praktikum Mobile und Verteilte Systeme

How to support multiple screens using android? Synopsis

Android. (XKE Mars 2009) Erwan Alliaume.

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

CS378 -Mobile Computing. Anatomy of and Android App and the App Lifecycle

Pro Android 2. Sayed Y. Hashimi Satya Komatineni Dave Mac Lean. Apress

Software Practice 3 Before we start Today s lecture Today s Task Team organization

Android Development Tools = Eclipse + ADT + SDK

Mobile Application Development Android

Getting Started. Dr. Miguel A. Labrador Department of Computer Science & Engineering

Figure 2.10 demonstrates the creation of a new project named Chapter2 using the wizard.

Introduction to Android

Chapter 1 Hello, Android

Mobile Application Development Android

INTRODUCTION TO ANDROID

Mobile Application Workbench. SAP Mobile Platform 3.0 SP02

Mobile Development Lecture 10: Fragments

Android - open source mobile platform

Android Beginners Workshop

SHWETANK KUMAR GUPTA Only For Education Purpose

Android Fundamentals - Part 1

CS 4518 Mobile and Ubiquitous Computing Lecture 2: Introduction to Android. Emmanuel Agu

Ahmed Ali Big fan of Android

Android App Development. Ahmad Tayeb

Mobile Programming Lecture 1. Getting Started

IEMS 5722 Mobile Network Programming and Distributed Server Architecture

CS 234/334 Lab 1: Android Jump Start

CS 4518 Mobile and Ubiquitous Computing Lecture 5: Rotating Device, Saving Data, Intents and Fragments Emmanuel Agu

Android Programmierung leichtgemacht. Lars Vogel

Mobile Application Development Android

In this Class Mark shows you how to put applications into packages and how to run them through the command line.

Chapter 5 Defining the Manifest

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

Transcription:

Mobile Application Development - Android MTAT.03.262 Satish Srirama satish.srirama@ut.ee

Goal Give you an idea of how to start developing Android applications Introduce major Android application concepts Walk you through some sample applications in the development environment 9/1/2014 Satish Srirama 2/33

References & Books Android developers http://developer.android.com/ Books Professional Android 4 Application Development, By Reto Meier 9/1/2014 Satish Srirama 3/33

What is Android? Android is not a device or a product It s not even limited to phones - you could build a handheld GPS, an MP3 player, etc. A free, open source mobile platform Open Handset Alliance 70+ technology companies Commitment to openness, shared vision, and concrete plans A Linux-based, multiprocess, multithreaded OS The Android operating system is a multi-user Linux system in which each application is a different user 9/1/2014 Satish Srirama 4/33

Android applications are written in Java package com.google.android.helloactivity; import android.app.activity; import android.os.bundle; public class HelloActivity extends Activity { public HelloActivity() { } @Override public void oncreate(bundle icicle) { super.oncreate(icicle); setcontentview(r.layout.hello_activity); } } 9/1/2014 Satish Srirama 5/33

Android applications are compiled to Dalvik bytecode Write app in Java Compiled in Java Transformed to Dalvik bytecode Loaded into Dalvik VM Linux OS Android Platform 9/1/2014 Satish Srirama 6/33

Why Dalvik? The Dalvik runtime is optimized for mobile applications Runs multiple VMs efficiently Each application has its own VM Minimal memory footprint Relies on Linux kernel for threading and lowlevel memory management 9/1/2014 Satish Srirama 7/33

Android software stack 9/1/2014 Satish Srirama 8/33

Can assume that most devices have android 2.3.x or 4.x http://developer.android.com/resources/dashboard/platform-versions.html 9/1/2014 Satish Srirama 9/33

Android has a working emulator 9/1/2014 Satish Srirama 10/33

Getting started I hope all of you have Android SDK installed You also have ADT Plugin 22.6.2 or higher for Eclipse Downloaded the latest SDK tools and platforms (version 19) using the SDK Manager http://developer.android.com/training/basics/firstapp/index.h tml Alternative Download ADT Bundle for windows Which has everything setup for you Download the latest SDK tools and platforms (version 19) using the SDK Manager http://developer.android.com/sdk/index.html 9/1/2014 Satish Srirama 11/33

Exercise: Hello World Let us create an AVD (Android virtual device) Create a New Android Project Construct the UI Run the Application Upgrade the UI to an XML Layout Let us debug 9/1/2014 Satish Srirama 12/33

Debugging in Android Traditional System.out.println is not available in the Android system We can debug through the app user interface Errors crash and close app Instead use Logging mechanisms Log.v(String tag, String message); tag -> app name Message -> debug message. Requires importing android.util.log Log messages appear in the LogCatcomponent of the Eclipse interface in Debug mode 9/1/2014 Satish Srirama 13/33

What s in an Application? Libraries Default Activity Other Activities Services Content Android Manifest Drawable Layouts Values Assets 9/1/2014 Satish Srirama 14/33

File structure of applications code files Auto generated resource list images UI layouts Android Manifest constants 9/1/2014 Satish Srirama 15/33

Application Manifest Each Android project has a manifest file Defines the structure and metadata of the application Includes nodes for each of the application components (Activities, Services, Intents etc.) Also includes security permissions 9/1/2014 Satish Srirama 16/33

Application Manifest - continued 9/1/2014 Satish Srirama 17/33

Security in Android Follows standard Linux guidelines Each application runs in its own process Process permissions are enforced at user and group IDs assigned to processes Finer grained permissions are then granted (revoked) per operations Apps declare permissions in manifest <uses-permission id="android.permission.receive_sms" /> 9/1/2014 Satish Srirama 18/33

Android Design Philosophy Applications should be: Fast Resource constraints: <200MB RAM, slow processor Responsive Apps must respond to user actions within 5 seconds Secure Apps declare permissions in manifest Seamless Usability is key, persist data, suspend services Android kills processes in background as needed 9/1/2014 Satish Srirama 19/33

Application priority and process states Android applications have limited control over their life cycles Each application runs in its own process Each process is running a separate instance of Dalvik Memory and process management is handled by runtime Runtime may kill some services in the background Application priority is critical 9/1/2014 Satish Srirama 20/33

Application priority Reto Meier, Professional Android 2 Application Development, p 59 9/1/2014 Satish Srirama 21/33

Android application lifecycle Apps move through states during lifecycle Understanding app lifecycle is necessary, so that apps: Does not crash if the user receives a phone call or switches to another app while using your app Does not consume valuable system resources when the user is not actively using it Does not lose the user's progress if they leave your app and return to it at a later time Does not crash or lose the user's progress when the screen rotates between landscape and portrait orientation 9/1/2014 Satish Srirama 22/33

Android application lifecycle - continued Transient states Static states 9/1/2014 Satish Srirama http://developer.android.com/training/basics/activity-lifecycle/starting.html 23/33

The History of GUIs Hardcoded to the screen Hardcoded to the window Hardcoded within a view hierarchy Dynamic layout within a view hierarchy 9/1/2014 Satish Srirama 24/33

Generating GUIs in Android Two ways to create GUIs: in XML or in code 9/1/2014 Satish Srirama 25/33

Advantages of Declarative route via XML Separation of appearance (presentation) from actual meaningful state-changing code Can change interface without having to completely recompile Java code Can just recompile XML View Resource is inflated at runtime 9/1/2014 Satish Srirama 26/33

Generating GUIs in Android - continued A lot of your GUI-related work will take place in: res/layout res/values @+id/name_for_component gives you handle for referencing XML declarations in code Button button = (Button) findviewbyid(r.id.button1); 9/1/2014 Satish Srirama 27/33

Working with resources Application resources are stored under res/ There are different types of resources String resources Saved in res/values/ and accessed from the R.string 9/1/2014 Satish Srirama 28/33 http://developer.android.com/guide/topics/resources/available-resources.html

Working with resources - continued Color resources Saved in res/color/ and accessed from the R.color class Style resources Saved in res/values/ and accessed from the R.style class Layout resources http://developer.android.com/guide/topics/resources/available-resources.html 9/1/2014 Satish Srirama 29/33

Advantages of structured resources One can maintain resources independently and can group based on types Android selects which alternative resource to use at runtime Depending on the current device configuration Help in providing alternative resources based on device types Localizing the applications 9/1/2014 Satish Srirama 30/33

Supporting different screens Four generalized sizes small, normal, large, xlarge Four generalized densities low (ldpi), medium (mdpi), high (hdpi), extra high (xhdpi) res/layout res/layout-large res/layout-land-large res/drawable-ldpi res/drawable-hdpi http://developer.android.com/training/basics/supporting-devices/screens.html 9/1/2014 Satish Srirama 31/33

Localizing the applications Supporting different languages res/values res/values-en res/values-fr Help in localizing the applications res/drawable-de-rde/ res/drawable-fr-rca/ http://developer.android.com/training/basics/supporting-devices/languages.html 9/1/2014 Satish Srirama 32/33

Homework Play with life cycle methods Have a layout with 2 EditTexts and 2 TextViewsand try to manage the input under different conditions like application paused, resumed, stopped, destroyed. Have the same application dealing with language, localization and landscape movement issues Upload the project to course tasks Deadline: A day before the next lecture. So 7 th September 2014. 9/1/2014 Satish Srirama 33/33