Chapter 2 Getting Started



Similar documents
Android Development. Marc Mc Loughlin

MMI 2: Mobile Human- Computer Interaction Android

Android Introduction. Hello Mihail L. Sichitiu 1

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

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

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

Mobile Application Development

Android For Java Developers. Marko Gargenta Marakana

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Getting Started: Creating a Simple App

Android Environment SDK

Developing Android Apps: Part 1

How to build your first Android Application in Windows

Android Programming Basics

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

Android Environment SDK

Android Concepts and Programming TUTORIAL 1

Introduction to Android SDK Jordi Linares

Getting Started With Android

App Development for Android. Prabhaker Matet

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

Introduction to Android. CSG250 Wireless Networks Fall, 2008

Hello World. by Elliot Khazon

Android Programming and Security

Android Development Tutorial. Human-Computer Interaction II (COMP 4020) Winter 2013

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

Lecture 1 Introduction to Android

Android 多 核 心 嵌 入 式 多 媒 體 系 統 設 計 與 實 作

4. The Android System

Developing an Android App. CSC207 Fall 2014

Android App Development. Rameel Sethi

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

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

How To Develop Android On Your Computer Or Tablet Or Phone

Android Basics. Xin Yang

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

Mocean Android SDK Developer Guide

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

How to Create an Android Application using Eclipse on Windows 7

Android Java Live and In Action

Location-Based Services Design and Implementation Using Android Platforms

Tutorial #1. Android Application Development Advanced Hello World App

OpenCV on Android Platforms

Running a Program on an AVD

Università Degli Studi di Parma. Distributed Systems Group. Android Development. Lecture 2 Android Platform. Marco Picone

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

An Introduction to Android Application Development. Serdar Akın, Haluk Tüfekçi

Smartphone market share

Frameworks & Android. Programmeertechnieken, Tim Cocx

06 Team Project: Android Development Crash Course; Project Introduction

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

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

Android Application Development - Exam Sample

Fahim Uddin 1. Java SDK

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

Android ( ) Frank Ducrest

Android Tutorial. Larry Walters OOSE Fall 2011

Building Your First App

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)

Presenting Android Development in the CS Curriculum

Android Apps Development Boot Camp. Ming Chow Lecturer, Tufts University DAC 2011 Monday, June 6, 2011

Android Bootcamp. Elaborado (com adaptações) a partir dos tutoriais:

Open Source Telemedicine Android Client Development Introduction

ADT Plugin for Eclipse

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

With a single download, the ADT Bundle includes everything you need to begin developing apps:

A software stack for mobile devices:

IOIO for Android Beginners Guide Introduction

Jordan Jozwiak November 13, 2011

Android Persistency: Files

Basics. Bruce Crawford Global Solutions Manager

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

Getting Started with Android Development

Introduction to Android Programming (CS5248 Fall 2015)

How to develop your own app

Getting started with Android and App Engine

BEGIN ANDROID JOURNEY IN HOURS

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

PubMatic Android SDK. Developer Guide. For Android SDK Version 4.3.5

Android Setup Phase 2

Based on Android 4.0. by Lars Vogel. Version 9.8. Copyright 2009, 2010, 2011, 2012 Lars Vogel Home Tutorials Trainings Books Social

Mobile Application Development Android

Introduction to Android Android Architecture Software Development Purpose of the project Location Based Service (LBS) Android. Location class Google

MAP524/DPS924 MOBILE APP DEVELOPMENT (ANDROID) MIDTERM TEST OCTOBER 2013 STUDENT NAME STUDENT NUMBER

Android Application Development Lecture Notes INDEX

UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

Tutorial: Setup for Android Development

The power of root on Android emulators

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

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

Developing NFC Applications on the Android Platform. The Definitive Resource

Android Programming Tutorials. by Mark L. Murphy

Transcription:

Welcome to Android

Chapter 2 Getting Started Android SDK contains: API Libraries Developer Tools Documentation Sample Code Best development environment is Eclipse with the Android Developer Tool (ADT) plugin which integrates developer tools

Android Portability Android applications run within the Dalvik virtual machine Development Platforms: Windows (XP, Windows, 7) Linux Mac OS 10.4.8 or later (Intel chips only)

HelloWorld Android Activity File->New->(Android Project or Other->Android Project)

Skip New Android Test Project

HelloWorld Android Project

Running Android Project Before you can run an Android application, you need to create an Android Virtual Device (AVD) 1.Window->Android SDK and AVD Manager 2.Create a virtual device called AVD1.1 using the 1.1 Platform 3.Use an SD Card of 32MB for later

Creating Virtual Device

Creating Virtual Device

Run HelloWorld on AVD1.1

public class HelloWorld extends Activity { /** Called when the activity is first created. */ @Override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); } } A Quick Look At HelloWorld //HelloWorld.java package edu.pacificu.cs.helloworld; import android.app.activity; import android.os.bundle;

HelloWorld.java Activity base class that contains UI components for the application similar to a Form for Desktop Apps Views are the visual components describing the layout of the visual interface oncreate is overridden to do the activities normal static setup savedinstancestate is a Bundle that contains the Activities previously frozen state (if one exists) super.oncreate(savedinstancestate); setcontentview creates a UI using a static View resource in this case setcontentview (R.layout.main);

Android Resources Android resources are stored in the res folder which minimally consists of folders: drawable layout values XML resources are specified in main.xml to describe at UI layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/a ndroid" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> </LinearLayout>

Questions 1. What kind of argument does setcontentview accept? 2. Why is R.layout.main an acceptable argument for setcontentview? 3. Is there a text field in the application? If so, what is the name of the text field? 4. How would you change the program to print out Hello Yourname?

HelloWorld Displayed In Code 04.code\HelloWorld package edu.pacificu.cs.helloworld; import android.app.activity; import android.os.bundle; import android.view.viewgroup.layoutparams; import android.widget.linearlayout; import android.widget.textview; public class HelloWorld extends Activity { TextView hellotextview; // assigned TextView resource private static boolean busexml = true; /** Called when the activity is first created. */ @Override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); } if (busexml) usexmllayout(); else usecodelayout();

HelloWorld Continued // Using XML layout resource to create UI private void usexmllayout() { setcontentview (R.layout.main); hellotextview = (TextView) findviewbyid (R.id.helloTextView); }

HelloWorld Continued // Create and populate layout in code private void usecodelayout() { LinearLayout.LayoutParams layoutparams = new LinearLayout.LayoutParams (LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); LinearLayout.LayoutParams textviewlayoutparams = new LinearLayout.LayoutParams (LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); LinearLayout linearlayout = new LinearLayout (this); linearlayout.setorientation (LinearLayout.VERTICAL); hellotextview = new TextView (this); hellotextview.settext ("Hello Yourname"); } } linearlayout.addview (hellotextview, textviewlayoutparams); addcontentview (linearlayout, layoutparams);

Android Developers Guide http://developer.android.co m/guide/index.html

Android Development Tools Android Emulator Android virtual machine Dalvik Debug Monitoring Service (DDMS) used for debugging apps Android Asset Packaging Tool (AAPT) creates distributable Android package files (.apk) Android Debug Bridge (ADB) client-server app providing communication with a running app SQLite3 used to access SQLLite database files Traceview used to view trace logs from an Android app MkSDCard creates an SDCard disk image dx converts Java bytecode to Android bytecode activitycreator builds Ant files to compile Android apps without ADT plugin