Android For Java Developers. Marko Gargenta Marakana



Similar documents
Android Introduction. Hello Mihail L. Sichitiu 1

Mobile Application Development

Chapter 2 Getting Started

Android Development. Marc Mc Loughlin

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

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

Introduction to Android. CSG250 Wireless Networks Fall, 2008

Basics. Bruce Crawford Global Solutions Manager

App Development for Android. Prabhaker Matet

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

Developing Android Apps: Part 1

4. The Android System

Building an Android client. Rohit Nayak Talentica Software

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

MMI 2: Mobile Human- Computer Interaction Android

Android Services. Services

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

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

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

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

Tutorial #1. Android Application Development Advanced Hello World App

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

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

Android Basics. Xin Yang

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

Hacking your Droid ADITYA GUPTA

Android Application Development

SDK Quick Start Guide

Operating System Support for Inter-Application Monitoring in Android

Tutorial: Setup for Android Development

Programming with Android: System Architecture. Dipartimento di Scienze dell Informazione Università di Bologna

Smartphone market share

Learning Android Marko Gargenta

Mobile Security - Tutorial 1. Beginning Advanced Android Development Brian Ricks Fall 2014

Developing an Android App. CSC207 Fall 2014

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

Introduction to Android SDK Jordi Linares

Android Concepts and Programming TUTORIAL 1

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

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

How To Develop Android On Your Computer Or Tablet Or Phone

BEGIN ANDROID JOURNEY IN HOURS

Location-Based Services Design and Implementation Using Android Platforms

ECWM511 MOBILE APPLICATION DEVELOPMENT Lecture 1: Introduction to Android

06 Team Project: Android Development Crash Course; Project Introduction

Building Your First App

Android Java Live and In Action

Deep Inside Android. OpenExpo Zurich September 25 th, Gilles Printemps - Senior Architect. Copyright 2007 Esmertec AG.

Presenting Android Development in the CS Curriculum

Introduction to Android Development. Jeff Avery CS349, Mar 2013

AndroLIFT: A Tool for Android Application Life Cycles

Android Geek Night. Application framework

Getting Started With Android

Android Programming Basics

Hello World. by Elliot Khazon

Using Extensions or Cordova Plugins in your RhoMobile Application Darryn

Introduction to NaviGenie SDK Client API for Android

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

Getting Started: Creating a Simple App

A software stack for mobile devices:

How to build your first Android Application in Windows

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

Mocean Android SDK Developer Guide

Android Fundamentals 1

Woubshet Behutiye ANDROID ECG APPLICATION DEVELOPMENT

ELET4133: Embedded Systems. Topic 15 Sensors

Android App Development. Rameel Sethi

Android Programming. An Introduction. The Android Community and David Read. For the CDJDN April 21, 2011

Android Development Tutorial

Jordan Jozwiak November 13, 2011

Localization and Resources

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

Mobile Application Development Android

Frameworks & Android. Programmeertechnieken, Tim Cocx

Android Environment SDK

Android Application Model

Developing apps for Android OS: Develop an app for interfacing Arduino with Android OS for home automation

Basics of Android Development 1

AN How to build a NFC Application on Android. Application note COMPANY PUBLIC. Rev September Document information

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

Android Developer Fundamental 1

CSE476 Mobile Application Development. Yard. Doç. Dr. Tacha Serif Department of Computer Engineering Yeditepe University

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

andbook! Android Programming written by Nicolas Gramlich release with Tutorials from the anddev.org-community.

An Introduction to Android

Android Application Development Lecture Notes INDEX

Tutorial for developing the Snake Game in Android: What is Android?

Transcription:

Android For Java Developers Marko Gargenta Marakana

Agenda Android History Android and Java Android SDK Hello World! Main Building Blocks Debugging Summary

History 2005 Google buys Android, Inc. Work on Dalvik starts 2007 OHA Announced Early SDK 2008 G1 Announced SDK 1.0 Released 2009 G2 Released Cupcake, Donut, Eclair

Android Java = Java SE AWT/Swing + Android API Android and Java

Android SDK - What s in the box SDK Tools Docs Platforms Data Skins Images Samples Add-ons Google Maps

The Tools Tools are important part of the SDK. They are available via Eclipse plugin as well as command line shell.

HELLO WORLD!

Create New Project Use the Eclipse tool to create a new Android project. Here are some key constructs: Project Target App name Package AcXvity Eclipse construct minimum to run whatever Java package Java class

The Manifest File <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.marakana" android:versioncode="1" android:versionname="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".helloandroid" 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="5" /> </manifest>

The Layout Resource <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 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>

The Java File package com.marakana; import android.app.activity; import android.os.bundle; public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); } }

Running on Emulator

MAIN BUILDING BLOCKS

AcXviXes Activity is to an application what a web page is to a website. Sort of. Android Application Main Activity Another Activity Another Activity

AcXvity Lifecycle Starting Activities have a welldefined lifecycle. The Android OS manages your activity by changing its state. You fill in the blanks. Stopped (1) oncreate() (2) onstart() (3) onrestoreinstancestate() (4) onresume() Running (3) onresume() (2) onstart() (1) onrestart() onresume() (1) onsaveinstancestate() (2) onstop() (1) onsaveinstancestate() (2) onpause() Paused ondestroy() or <process killed> <process killed> Destroyed

Intents Intents are to Android apps what hyperlinks are to websites. They can be implicit and explicit. Sort of like absolute and relative links. Android Application Main Activity Android Application Main Activity Intent Intent Another Activity Intent Another Activity

Services A service is something that can be started and stopped. It doesn t have UI. It is typically managed by an activity. Music player, for example

Service Lifecycle Service also has a lifecycle, but it s much simpler than activity s. An activity typically starts and stops a service to do some work for it in the background. Such as play music, check for new tweets, etc. Stopped ondestroy() or <process killed> onstart() Starting Destroyed onstop() (1) oncreate() (2) onstart() Running

Content Providers Content Providers share content with applications across application boundaries. Examples of built-in Content Providers are: Contacts, MediaStore, Settings and more. Content URI insert() update() delete() query() Content Provider

Broadcast Receivers An Intent-based publish-subscribe mechanism. Great for listening system events such as SMS messages.

DEBUGGING ANDROID APPS

LogCat The universal, most versatile way to track what is going on in your app. Can be viewed via command line or Eclipse. Logs can be generated both from SDK Java code, or low-level C code via Bionic libc extension.

Debugger Your standard debugger is included in SDK, with all the usual bells & whistles.

TraceView TraceView helps you profile you application and find bottlenecks. It shows execution of various calls through the entire stack. You can zoom into specific calls.

Hierarchy Viewer Hierarchy Viewer helps you analyze your User Interface. Base UI tends to be the most expensive part of your application, this tool is very useful.

Summary Android is based on Java. You write Java code, but technically don t run it. Java is augmented with XML, mostly for UI purposes. Android Java is mostly based on Java SE with replacement UI libraries. Marko Gargenta, Marakana.com marko@marakana.com +1-415-647-7000 Licensed under Creative Commons License (cc-by-nc-nd). Please Share!