Android App Development

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

Developing Android Apps: Part 1

Tutorial #1. Android Application Development Advanced Hello World App

Mobile Application Development

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

Android Development Tutorial

Introduction to Android Development. Daniel Rodrigues, Buuna 2014

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

Android Introduction. Hello Mihail L. Sichitiu 1

Chapter 2 Getting Started

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

Presenting Android Development in the CS Curriculum

MMI 2: Mobile Human- Computer Interaction Android

Android Development. Marc Mc Loughlin

Developing an Android App. CSC207 Fall 2014

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

Getting Started: Creating a Simple App

Android Basics. Xin Yang

Basics. Bruce Crawford Global Solutions Manager

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

Jordan Jozwiak November 13, 2011

Tutorial: Setup for Android Development

Getting started with Android and App Engine

Android For Java Developers. Marko Gargenta Marakana

Building Your First App

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

Android Application Development. Daniel Switkin Senior Software Engineer, Google Inc.

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

SDK Quick Start Guide

Android Environment SDK

App Development for Android. Prabhaker Matet

Software Environments of Smartphone Applications

Building an Android client. Rohit Nayak Talentica Software

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

Android Environment SDK

A software stack for mobile devices:

By sending messages into a queue, we can time these messages to exit the cue and call specific functions.

TUTORIALS AND QUIZ ANDROID APPLICATION SANDEEP REDDY PAKKER. B. Tech in Aurora's Engineering College, 2013 A REPORT

Android Java Live and In Action

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

Smartphone market share

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

Mobile Application Development Android

Android Application Development - Exam Sample

Hacking your Droid ADITYA GUPTA

ANDROID TUTORIAL. Simply Easy Learning by tutorialspoint.com. tutorialspoint.com

Localization and Resources

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

Frameworks & Android. Programmeertechnieken, Tim Cocx

Mobile Application Frameworks and Services

4. The Android System

Android for Java Developers OSCON Marko Gargenta Marakana

Android app development course

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

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

UNIVERSITY AUTHORISED EDUCATION PARTNER (WDP)

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

Android Tutorial. Larry Walters OOSE Fall 2011

Android Programming Basics

Mobile Application Development 2014

Workshop on Android and Applications Development

Lecture 1 Introduction to Android

Introduction to Android

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

Android Development Introduction CS314

Google s Android: An Overview

Android. Learning Android Marko Gargenta. Tuesday, March 11, 14

Introduction to Android SDK Jordi Linares

Android Programming and Security

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

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

Introduction to NaviGenie SDK Client API for Android

Tutorial: Android Object API Application Development. SAP Mobile Platform 2.3

Android Application Development. Yevheniy Dzezhyts

CS 696 Mobile Phone Application Development Fall Semester, 2009 Doc 9 Location & Maps Sept 29, 2009

Android App Development. Rameel Sethi

Running a Program on an AVD

Developing In Eclipse, with ADT

Hello World! Some code

1. Introduction to Android

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

Developing NFC Applications on the Android Platform. The Definitive Resource

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

Tutorial: Android Object API Application Development. Sybase Unwired Platform 2.2 SP02

Android Concepts and Programming TUTORIAL 1

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

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

5 reasons to choose Streamezzo SDK over Android SDK Page 2

Saindo da zona de conforto resolvi aprender Android! by Daniel Baccin

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

Programming with Android

Location-Based Services Design and Implementation Using Android Platforms

Getting Started with Android

Login with Amazon Getting Started Guide for Android. Version 2.0

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

Introduction to Android

HERE SDK for Android. Developer's Guide. Online Version 2.1

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

ANDROID INTRODUCTION TO ANDROID

Transcription:

Android App Development 11-20-2013

Android app development Recommend: use the Eclipse+ADT bundle Read: http://developer.android.com Building your first app Dan Morrill (Clarkson grad) PR#2 due: Wednesday, 12/04/13

Lars Vogel www.vogella.com/articles/android/article.html

Applications The Android Open Source project contains several default application, like the Browser, Camera, Gallery, Music, Phone and more. Application framework API which allows for high-level interaction with the Android system from Android applications. Libraries and runtime Libraries for the Application Framework for many functions (graphic rendering, data storage, web browsing, etc.) and the Dalvik runtime and the core Java libraries for running Android applications. Linux kernel Communication layer for the underlying hardware.

Android applications and tasks An Android application consists of different Android components and additional resources. Components are: activities, services, broadcast receiver and content provider. Android application components can connect to components of other Android applications to create tasks. Android user interface components Activity, Fragments, Views and layout manager

Intents asynchronous message which allow the app to requrest functionality from other Android components, e.g. from services or activites Services services perform tasks without a user interface ContentProvider a content provider gives a structured interface to application data, so your app can share data with other apps via a content provider. A SQLite database stores data which is accessed via a content provider. Widgets interactive components primarily used on the homescreen Live Wallpapers

Android SDK tools to create, compile and package an app create Android virtual devices (AVD) contains the Android debug bridge (adb) tool which has the ability to connect to a virtual or real Android device Android Development Tools (ADT) create, compile, debug and deploy Android apps from the Eclipse IDE provides editors that allow you to switch between the XML representation of a file and a visual user interface via tabs on the bottom of the editor Dalvik Virtual Machine Java class files must be converted to Dalvik bytecode format (.dex); Android package (.apk)

Google vs. Android AVD Device emulator shortcuts Shortcut Alt + Enter Ctrl + F11 F8 Description Maximizes the emulator Changes the orientation of the emulator from landscape to portrait and vice versa Turns the network on and off

Do not interrupt this startup process, since this might corrupt the AVD. Once started, don t stop the AVD during your development.

Property Application Name Project Name Package Name API (minimum, target, ) Value MyApp edu.clarkson.cs242.myapp edu.clarkson.cs242.myapp latest

Right click on your project and select Run as -> Android Application May be prompted if ADT should monitor message - Yes

AndroidMainfest.xml describes components and settings of an Android app all activities, services and content providers of the app must be in this file; broadcast receiver can be defined statically in the manifest or dynamically in the app also contains the required permissions for the app if the app requires network access, must be specified in the manifest

AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="de.vogella.android.temperature" android:versioncode="1" android:versionname="1.0"> <application android:icon="@drawable/icon android:label="@string/app name"> <activity android:name=".convert" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> <uses-sdk android:minsdkversion="9" /> </manifest>

Resource Folder Description Drawables /res/drawables Images (e.g. png, jpeg) or XML files which describe a drawable Simple Values /res/values define strings, colors, dimensions, styles and integers via XML viles. By convention each type is stored in a separate file. Strings are defined in res/values/strings.xml Layouts /res/layout XML files with layout descriptions Styles and Themes /res/values Animations /res/animator define the appearance of your Android app defines animations in XML Raw data /res/raw data files in raw form, accessed via an InputStream Menus /res/menu describes properties of menu entries

Every resource file gets an ID assigned by the Android build system The gen directory in the project contains the R.java references file which contain these generated values Methods are provided to access the resource files via these IDs e.g. to access a String with the R.string.yourStringID, use getstring(r.string.yourstring)

A layout resource file specifies the ViewGroup, Views and their relationships and attributes in XML <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".mainactivity" > <TextView android:id="@+id/mytext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" /> </RelativeLayout>

A layout is assigned to an activity via the setcontentview() method package com.vogella.android.first; import android.os.bundle; import android.app.activity; import android.view.menu; public class MainActivity extends Activity { @Override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } }

Property Application Name Project Name Value Temperature converter de.vogella.android.temperature Package name de.vogella.android.temperature API Template Activity Layout Latest BlankActivity MainActivity activity_main

Select res/values/string.xml to open the editor for this file

<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">temperature Converter</string> <string name="action_settings">settings</string> <string name="hello_world">hello world!</string> <color name="mycolor">#f5f5f5</color> <string name="celsius">to Celsius</string> <string name="fahrenheit">to Fahrenheit</string> <string name="calc">calculate</string> </resources> Continue with the tutorial to complete the temperature app

Create an Android app to play the dice game Pig cf: wikipedia & about.com for the rules