The Android Development Environment. Adam Porter

Similar documents
Hello World. by Elliot Khazon

How to build your first Android Application in Windows

Android Development. 吳 俊 興 國 立 高 雄 大 學 資 訊 工 程 學 系

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

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Android Environment SDK

Android Development. Marc Mc Loughlin

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

Android Setup Phase 2

Android For Java Developers. Marko Gargenta Marakana

Chapter 2 Getting Started

MMI 2: Mobile Human- Computer Interaction Android

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

Android Environment SDK

How to Create an Android Application using Eclipse on Windows 7

Getting Started: Creating a Simple App

Android Introduction. Hello Mihail L. Sichitiu 1

Getting Started with Android Development

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

Advantages. manage port forwarding, set breakpoints, and view thread and process information directly

Android Development Setup [Revision Date: 02/16/11]

Mobile Application Development

Android Development Tutorial. Nikhil Yadav CSE40816/ Pervasive Health Fall 2011

Android Tutorial. Larry Walters OOSE Fall 2011

ID TECH UniMag Android SDK User Manual

directory to "d:\myproject\android". Hereafter, I shall denote the android installed directory as

Android Programming: Installation, Setup, and Getting Started

Jordan Jozwiak November 13, 2011

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

Running a Program on an AVD

Mobile Application Development Android

Fahim Uddin 1. Java SDK

Advertiser Campaign SDK Your How-to Guide

Developing Android Apps: Part 1

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

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

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

Testing Mobile Apps CS 4720 Web & Mobile Systems

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

Android Basics. Xin Yang

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)

Installing the Android SDK

Introduction to NaviGenie SDK Client API for Android

How to develop your own app

Appium mobile test automation

Android Environment Emulator

Lab 0 (Setting up your Development Environment) Week 1

Programming Android Smart Phones. Tom Chothia Internet Computing Workshop

Getting Started with Android

How To Develop An Android App On An Android Device

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

Tutorial on Basic Android Setup

Arduino & Android. A How to on interfacing these two devices. Bryant Tram

ADT Plugin for Eclipse

Android Framework. How to use and extend it

Intro to Android Development 2. Accessibility Capstone Nov 23, 2010

Admin. Mobile Software Development Framework: Android Activity, View/ViewGroup, External Resources. Recap: TinyOS. Recap: J2ME Framework

Intel Integrated Native Developer Experience (INDE): IDE Integration for Android*

Android Application Development - Exam Sample

Introduction to Android Development. Jeff Avery CS349, Mar 2013

Now that we have the Android SDK, Eclipse and Phones all ready to go we can jump into actual Android development.

How To Develop Android On Your Computer Or Tablet Or Phone

Mobile Application Development 2014

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

Lecture 1 Introduction to Android

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

Introduction to Android SDK Jordi Linares

Home Course Catalog Schedule Pricing & Savings Training Options Resources About Us

Example Connection between USB Host and Android

Android ( ) Frank Ducrest

Developing In Eclipse, with ADT

Building Your First App

Setting up Sudoku example on Android Studio

Basic Android Setup Windows Version

Application Development Setup Guide

Android Geek Night. Application framework

Introduction to Android. CSG250 Wireless Networks Fall, 2008

OpenCV on Android Platforms

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 (

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

Android Developer Fundamental 1

Android Programming and Security

Android for Java Developers OSCON Marko Gargenta Marakana

Android 4.4 App Development Essentials

Developing NFC Applications on the Android Platform. The Definitive Resource

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

Login with Amazon Getting Started Guide for Android. Version 2.0

Mobile Application Frameworks and Services

DEVELOPING MOBILE APPLICATIONS USING ANDROID

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

Android Security Lab WS 2014/15 Lab 1: Android Application Programming

CS378 -Mobile Computing. Android Overview and Android Development Environment

2. Click the download button for your operating system (Windows, Mac, or Linux).

Title: Appium Automation for Mac OS X. Created By: Prithivirajan M. Abstract. Introduction

1) SETUP ANDROID STUDIO

Oracle FLEXCUBE Direct Banking Android Tab Client Installation Guide Release

IOIO for Android Beginners Guide Introduction

Mocean Android SDK Developer Guide

Open Source Telemedicine Android Client Development Introduction

Transcription:

The Android Development Environment Adam Porter

Today s Topics Getting started on the Android Platform Installing required libraries Programming Android in Eclipse The Android emulator Debugging Android applications Other tools

Installation See http://developer.android.com/sdk/index.html#quickstart Steps Java Platform SE Eclipse IDE Android SDK starter package Eclipse ADT plugin Add Android platform & other comps to SDK

Java Download Java Development Kit http://java.sun.com/javase/downloads/

Eclipse Preferred IDE, but you can use others Requires version 3.4 or higher http://www.eclipse.org/downloads/

Android SDK starter package Core tools needed to get started http://developer.android.com/sdk/ Unpack files to a directory of your choice By default: android-sdk-<machine-platform> Add this directory to your path to use Android tools from the command line

Eclipse ADT plugin Download the ADT plugin Use the Help -> Install New Software function URL for Eclipse 3.5+ https://dl-ssl.google.com/android/eclipse/ Configure plugin Open preferences, click on Android and set the SDK location

Add Components to SDK Launch the Android SDK and AVD Manager Select at least the latest platform (2.2)

Create an Android Virtual Device AVD is a configuration of emulator options Each AVD includes Hardware profile Platform Other options e.g., Skin, screen dimensions, SD card size Storage area Can be created in Android SDK and AVD Manager

Hello Android Create a new Android project Project name: HelloAndroid Application name: Hello, Android Package name: edu.umd.cs.cmsc498g Create activity: HelloAndroid Min SDK: 8

Hello Android (cont.) package edu.umd.cs.cmsc498g; import android.app.activity; import android.os.bundle; import android.widget.textview; public class HelloAndroid extends Activity { public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); TextView tv = new TextView(this); tv.settext("hello, Android"); setcontentview(tv); } }

The Android Emulator Can run Android applications in a simulated environment Advantages Fast turnaround Doesn t require actual hardware Uses faster CPU on emulation computer Disadvantages Not all features are not available e.g., no bluetooth emulation Performance & user experience can be misleading

The Android Emulator Emulates telephone calls & SMS messages % telnet localhost 5554 > send sms This is a text message Will emulate typical speeds & latencies for different networks (e.g., edge, gprs, etc.) % telnet localhost 5554 > set speed gprs Can interconnect multiple emulators % emulator -avd Android_2.2_primary % emulator -avd Android_2.2_secondary In one dialer app, dial port num of other emulator

The Android Emulator Many more options For more details, see: developer.android.com/guide/developing/tools/ emulator.html

Running in the Debugger

TraceView Automatically traces method entries and exits Add trace code to your application as follows: // start tracing to "/sdcard/calc.trace" Debug.startMethodTracing ("calc"); // stop tracing Debug.stopMethodTracing(); Will need to set permissions (disc. in later classes) <uses-permission android:name="android.permission.write_external_storage" />

TraceView To view results after execution % adb pull /sdcard/calc.trace /tmp % traceview /tmp/calc

Logcat The Android platform logs many events by default Developers can use the android.util.log to add application-specific logging View log entries with % adb logcat Or inside Eclipse Window -> Show View -> Other -> Android -> LogCat

Hierarchy Viewer % hierarchyviewer Layout inspector Shows runtime UI layout as a graph Pixel Perfect View Zoomable view of individual UI units Can manually force view refreshes

UI/Application Exerciser Monkey Send random events to applications Allows events to be scripted Feature is undocumented. // send event to browswer % adb shell monkey -p com.android.browser -v 500 // send events to all applications % adb shell monkey 500

Android Unit Testing Android-specific extensions to Junit MoreAsserts Additional result checking classes ViewAsserts Asserts about view layout TouchUtils Classes for generating touch events Instrumentation For monitoring application interaction with system

Android Unit Testing (cont.) Steps for testing Activity Create an Android test project Create one or more Android test classes Add code to each Test class Test code usually includes test methods for App initialization UI behavior & class functionality Application lifecycle state management

Android Unit Testing AndroidTestCase Test case with access to Activity Context ActivityUnitTestCase isolated testing of a single activity InstrumentationTestCase Test case with access to system instrumentation & events ActivityInstrumentationTestCase2 functional testing of a single activity Many other test case types http://developer.android.com/guide/topics/testing/ testing_android.html

Android Unit Testing (cont.) Junit Test flow Setup Put application in known state Run Create additional data Execute method under test Check result with Assert TearDown Return to known state

Android Unit Testing (cont.) http://developer.android.com/resources/tutorials/ testing/activity_test.html

Running on a Device See http://developer.android.com/guide/developing/ device.html Key steps Declare your application as "debuggable" in your Android Manifest Turn on "USB Debugging" on your device Setup your system to detect your device