Introduction to Android Development. Jeff Avery CS349, Mar 2013



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

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

Running a Program on an AVD

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

ITG Software Engineering

How To Develop Android On Your Computer Or Tablet Or Phone

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

Android Development. Marc Mc Loughlin

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 1 Android SDK & Development Environment. Marco Picone

Smartphone market share

Android Developer Fundamental 1

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

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

Introduction to Android

Tutorial on Basic Android Setup

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

Android Tutorial. Larry Walters OOSE Fall 2011

Basic Android Setup Windows Version

Open Source Telemedicine Android Client Development Introduction

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

Android Programming and Security

Android Application Development

Android Setup Phase 2

Android Programming: Installation, Setup, and Getting Started

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

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

Android Programming. Høgskolen i Telemark Telemark University College. Cuong Nguyen,

Introduction (Apps and the Android platform)

Introduction to Android Programming (CS5248 Fall 2015)

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

1. Introduction to Android

Workshop on Android and Applications Development

Android Geek Night. Application framework

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)

CS 528 Mobile and Ubiquitous Computing Lecture 2: Android Introduction and Setup. Emmanuel Agu

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

OpenCV on Android Platforms

Lecture 1 Introduction to Android

An Introduction to Android

The power of root on Android emulators

Android Environment SDK

Fahim Uddin 1. Java SDK

Android (Basic + Advance) Application Development

How to Create an Android Application using Eclipse on Windows 7

Getting Started with Android Development

Android Application Development Lecture Notes INDEX

Introduction to Android. CSG250 Wireless Networks Fall, 2008

Jordan Jozwiak November 13, 2011

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

Mobile Application Development Android

Android Environment SDK

Beginning Android Programming

Lab 0 (Setting up your Development Environment) Week 1

Mobile Application Development 2014

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

How To Develop An Android App On An Android Device

ADT Plugin for Eclipse

Praktikum Entwicklung Mediensysteme (für Master)

CS378 -Mobile Computing. Android Overview and Android Development Environment

Android For Java Developers. Marko Gargenta Marakana

Developing Google Android Mobile Clients for Web Services: a Case Study

Building an Android client. Rohit Nayak Talentica Software

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

Module Title: Software Development A: Mobile Application Development

GETTING STARTED WITH ANDROID DEVELOPMENT FOR EMBEDDED SYSTEMS

Tutorial on Basic Android Setup

Overview of CS 282 & Android

Practical Android Projects Lucas Jordan Pieter Greyling

Android Application Development

Programming with Android

COURSE CONTENT. GETTING STARTED Select Android Version Create RUN Configuration Create Your First Android Activity List of basic sample programs

Mobility Introduction Android. Duration 16 Working days Start Date 1 st Oct 2013

Developing NFC Applications on the Android Platform. The Definitive Resource

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

Frameworks & Android. Programmeertechnieken, Tim Cocx

Getting Started: Creating a Simple App

Synthesis for Developing Apps on Mobile Platforms

Android Development Tools for Eclipse

Android Architecture. Alexandra Harrison & Jake Saxton

Oracle FLEXCUBE Direct Banking Android Tab Client Installation Guide Release

Generate Android App

1) SETUP ANDROID STUDIO

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

What else can you do with Android? Inside Android. Chris Simmonds. Embedded Linux Conference Europe Copyright 2010, 2net Limited.

Introduction to Android

DEVELOPING MOBILE APPLICATIONS USING ANDROID

ANDROID APPLICATION FOR FILE STORAGE AND RETRIEVAL OVER SECURED AND DISTRIBUTED FILE SERVERS SOWMYA KUKKADAPU B.E., OSMANIA UNIVERSITY, 2010 A REPORT

ANDROID APP DEVELOPMENT: AN INTRODUCTION CSCI /19/14 HANNAH MILLER

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

Introduction to Android

Installing the Android SDK

How To Run A Hello World On Android (Jdk) On A Microsoft Ds.Io (Windows) Or Android Or Android On A Pc Or Android 4 (

Introduction to Android Development

XenMobile Logs Collection Guide

Introduction to Android

Android Application Development: Hands- On. Dr. Jogesh K. Muppala

Transcription:

Introduction to Android Development Jeff Avery CS349, Mar 2013

Overview What is Android? Android Architecture Overview Application Components Activity Lifecycle Android Developer Tools Installing Android SDK Creating an Android Project in Eclipse Activities, Views, Intents Walkthrough Hello World

What is Android? Google s mobile platform Runs on hundreds of millions of mobile phones, tablets Most popular & installed mobile OS Open Source Development platform Multiplatform Based on Java Plugins for Eclipse Third party support See http://developer.android.com/tools/index.html

Platform Characteristics This is a mobile OS with limited resources Limited memory, processing power Battery life is critical! This results in specific architectural decisions The OS aggressively flushes memory when not in use (i.e. it will page apps in and out of memory) Background computation is extremely limited Unusual device characteristics Small screen, typically focused on a single app Gestural input

Architectural Overview Layered environment Linux 2.6 kernel Core Android libraries/services built on top Top most layer runs in a VM Application management Applications are built in Java, running in a Dalvik VM Each application is a separate user/process/vm! Applications can share services and capabilities (see later)

Architecture

Application Components Core building blocks for Android applications Apps can publish components for other applications to use Use asynchronous message called Intent Intents and components defined in a Manifest file Eclipse will generate the manifest for you! Component Activity Service Content provider Broadcast receiver Description Single screen of an application Long running background application Provides shared set of application data Responds to system broadcast events

Application Anatomy Activity As above, each activity represents a screen View Superclass for widgets (sim. to java.awt.component class in Swing) UI as a collection of View objects Layout Managers still useful! Intent Publishable action

Activity Lifecycle We focus on activities (i.e. typical UI screens) Apps can contain multiple activities (one main ) Activities can create other activities ( Back stack ) Navigation forward/back triggered by user actions

What does this mean? Your application probably consists of one or two main activities, each containing a set of views (i.e. Java views and components) Running Paused / Stopped

Android Developer Tools Content from the slides is from the Android Developer Site: http://developer.android.com Tools Download Workflow API Guides App Components User Interface Intents

Installing the Android SDK Install tools from developer.android.com Eclipse plugin or ADT bundle (recommended!) ADT Bundle installs Eclipse & SDK Tools

Using the SDK Manager To install or update, run Window > Android SDK Manager The ADT install includes Android 4.2.2. That s fine for A5!

Creating a Project Three main steps 1. Create the project, using the New Project wizard in Eclipse. 2. Setup the Android Virtual Device, which you ll use to emulate a physical Android tablet or phone. 3. Setup the Run Configuration so that the project knows what starting activity to load, what Virtual Device to use (and so on).

Step 1: Creating a Project in ADT 1. File New Android Application Project 2. Project Settings Unique name Pick Android 4.2

Step 1: Creating a Project (2) 3. Configuration Create activity Create icon (accept defaults later) 4. Create Activity Choose blank 5. Blank Activity Options Accept defaults

Step 2: Creating a Virtual Device We don t have a physical device, so we use an emulator for testing and debugging Emulators are called Virtual Devices Steps to setup 1. Window > Android Virtual Device Manager Create a new virtual device w. parameters 2. Edit > Run Configurations Change target to point to virtual device

Step 2: Creating a Virtual Device (2)

Step 3: Run Configuration Run > Run Configurations Check that Activity points to your starting activity Check that VD points to the appropriate device

Step 4: Run your project This is the simple part: Run > Run should Compile your program Launch the Emulator and load your VD Execute your code in the Emulator If this fails, check your Run configuration first! That s usually where the problem lies.

Can we see some code? The Eclipse New Project wizard just generated some code. Before looking at it, recall the application lifecycle. This maps to code! Running Paused / Stopped

Hello World (1)

Hello World (2) Eclipse has created a default view for us stored as an XML file in the project

Hello World (3) Note that the Hello World view was inserted by the platform no code required. Google has a sense of humor. Emulator Output

Development Tips & Tricks (2) Use Logcat Logger that dumps all Android debug output to Eclipse, in the debug pane You can filter it based on App, Tag, Message text DIFFICULT to debug raw messages to rely on printing debug output and looking at Logcat

Development Tips & Tricks Tweak your emulator It s slow to launch, so don t shut it down! Give it lots of memory so apps aren t flushed Use MVC! It works well here Your model from A3 should port over cleanly Keep views separate, it will keep your code clean (i.e. separation of concerns applies) Look at the <sdk>/samples HUGE amount of code, it s the fastest way to learn patterns and best practices

Resources Android Developer Site http://developer.android.com/ Android Training Getting Started http://developer.android.com/training/index.html Android Developer Channel @YouTube http://www.youtube.com/user/androiddevelopers StackOverflow http://stackoverflow.com/