Android Workshop at @majug by @derwildemomo and @elektrojunge

29
Android Overview – Structure – Development Freitag, 15. Oktober 2010

description

This are the slides of an android workshop held by Moritz Haarmann (@derwildemomo) and Benjamin Reimold (@elektrojunge) at an event by Mannheim Java Usergroup (@majug) on 15th October, 2010 at University of Mannheim. The slides cover an introduction to various mobile os, the important concepts of the android os and various other important facts and information about the android ecosystem. Feel free to distribute this presentation under Creative Commons - Non Commercial Licence

Transcript of Android Workshop at @majug by @derwildemomo and @elektrojunge

Page 1: Android Workshop at @majug by @derwildemomo and @elektrojunge

AndroidOverview – Structure – Development

Freitag, 15. Oktober 2010

Page 2: Android Workshop at @majug by @derwildemomo and @elektrojunge

English slidesStill hoping for an english attendend, though.

Freitag, 15. Oktober 2010

Page 3: Android Workshop at @majug by @derwildemomo and @elektrojunge

Benjamin Reimold• Angewandte Informatik @ DHBW

Stuttgart

• Mobile Development, (Android/WinMo/…)

• started with JEE, a lot of .Net recently

• also a music and book addict,...

• aformatik Training & Consulting

• Twitter: @elektrojunge

• Member of GTUG NAFreitag, 15. Oktober 2010

Page 4: Android Workshop at @majug by @derwildemomo and @elektrojunge

Moritz Haarmann

• BSc @ HdM Stuttgart, Medieninformatik

• Mobile-Development, iPhone & Android

• Too much Java EE

• Vollzeit-Nerd

• CaperWhite GmbH

• Twitter: @derwildemomo

• Founder of GTUG NA

Freitag, 15. Oktober 2010

Page 5: Android Workshop at @majug by @derwildemomo and @elektrojunge

Agenda

• Mobile operating systems - overview

• Android fundamentals

• The walkthrough

• Android market

• Other interesting stuff

Freitag, 15. Oktober 2010

Page 6: Android Workshop at @majug by @derwildemomo and @elektrojunge

Mobile Operating Systems

Overview & Comparison

Freitag, 15. Oktober 2010

Page 7: Android Workshop at @majug by @derwildemomo and @elektrojunge

Android OS

• Free, almost open source

• Based on a Linux kernel and a custom virtual machine (more later)

• Most smartphones bought in the US are Androids ( 8/2010 )

• Google, you know.

Freitag, 15. Oktober 2010

Page 8: Android Workshop at @majug by @derwildemomo and @elektrojunge

Apple iOS

• Most popular smartphone OS for consumers

• Growing importance for usage in enterprise („consumerized IT“)

• Closed, yet very powerful platform

• Based on Unix

• Requires: Objective-C skills, money & a mac

Freitag, 15. Oktober 2010

Page 9: Android Workshop at @majug by @derwildemomo and @elektrojunge

Blackberry OS

• Widely used in corporate environments

• High security standards & detailed administration (BES)

• Uses Java technology (Java ME + proprietary stuff)

• Closely linked with the online services offered

Freitag, 15. Oktober 2010

Page 10: Android Workshop at @majug by @derwildemomo and @elektrojunge

Windows Phone 7

• „In the wild“ – still matters

• Lost market share dramatically over the last years

• Windows Phone 7 to bring Microsoft back

• Windows Phone 7 ~ iOS 2

Freitag, 15. Oktober 2010

Page 11: Android Workshop at @majug by @derwildemomo and @elektrojunge

US Smartphone Market Shares - „in the wild“

28%

9%3%

19%

35%

4%2%

iPhone Android Linux WiMo RIM WebOSSymbian

Nielsen, Q1/2010http://blog.nielsen.com/nielsenwire/online_mobile/iphone-vs-android/

Share of Nokia Phones Worldwide Gartner 2010:34,2 % Nokia Handys including feature phones

In August, Android phones were the most sold mobile OS in the US

• overall smartphone penetration

• 23%

• lates numbers from Nielsen

• Android 19%

• Blackberry 31%

• iPhone 28%

Freitag, 15. Oktober 2010

Page 12: Android Workshop at @majug by @derwildemomo and @elektrojunge

Android FundamentalsOS Structure – Concepts

Freitag, 15. Oktober 2010

Page 13: Android Workshop at @majug by @derwildemomo and @elektrojunge

Architecture

Linux KernelHAL – Power Management – IPC – …

Librariesthink of Freetype, WebKit, SQLite

Android Runtime(Android libraries & Dalvik VM)

Application Frameworkbasically everything your application will interact with

Applications

Freitag, 15. Oktober 2010

Page 14: Android Workshop at @majug by @derwildemomo and @elektrojunge

Dalvik VM

• Runtime for applications (1 VM per application!)

• Heavily optimized for mobile devices

• Custom executable format (.dex)

• Based on Apache Harmony JVM implementation

• Not able to run Java Bytecode, no Java VM

Größte Optimierung statischer Art: globaler Constant Pool für alle Klassen eines Pakets.

Andere Opcodes (2 byte statt 1 byte)

Bei der Installation wird noch optimiert, z.B. bei Byte Order, Inline Functions, Static linking...

Freitag, 15. Oktober 2010

Page 15: Android Workshop at @majug by @derwildemomo and @elektrojunge

Tools• Eclipse

+ Android Developer Tools+ Android Debugging Bridge+ Emulator or Device

• everything but the device is 100% free

• Code Generator: droidBreeder, only rudimentary

• UI Tool: DroidDraw

• MDD approach with Xtext, Acceleo, EMF

Freitag, 15. Oktober 2010

Page 16: Android Workshop at @majug by @derwildemomo and @elektrojunge

- „Shortcomings?“-„We call it personality!“

• No SOAP libraries included

• No „properties“-file as in Java but similar mechanism using the „res“-folder

• No native device/sd card encryption

• Limitted device management api

Freitag, 15. Oktober 2010

Page 17: Android Workshop at @majug by @derwildemomo and @elektrojunge

Terms you should knowor have heard of

Freitag, 15. Oktober 2010

Page 18: Android Workshop at @majug by @derwildemomo and @elektrojunge

Activity

• Fundamental application building block

• „One screen“

• Lifecycle methods

• Create – resume – pause – destroy – …

• The „V“ and the „C“ in MVC

Freitag, 15. Oktober 2010

Page 19: Android Workshop at @majug by @derwildemomo and @elektrojunge

Intents

• „Abstract Description of an operation to be performed“

• Android specific event mechanism

• Late binding

• Can be created and received at runtime

• IPC

Freitag, 15. Oktober 2010

Page 20: Android Workshop at @majug by @derwildemomo and @elektrojunge

Application Context

• Runtime object provided by the system

• Look up services

• IPC

• Anything outside your app is likely to use the context at some point

Freitag, 15. Oktober 2010

Page 21: Android Workshop at @majug by @derwildemomo and @elektrojunge

Other terms & stuff

• Services – background activities without UI

• Content provider – shareable data stores

• Broadcast receiver – listeners for global intents

• Bundle - a bundle of „extra“ information

• The Manifest file – sounds familiar, doesn‘t it?

Freitag, 15. Oktober 2010

Page 22: Android Workshop at @majug by @derwildemomo and @elektrojunge

Development WalkthroughReady, Set..

Freitag, 15. Oktober 2010

Page 23: Android Workshop at @majug by @derwildemomo and @elektrojunge

Development Walkthrough• What does the app do?

• Create a project

• The DDMS perspective

• Project structure

• Create a virtual device

• With or without Google APIs?

• Layout the 1st activity

Freitag, 15. Oktober 2010

Page 24: Android Workshop at @majug by @derwildemomo and @elektrojunge

Development Walkthrough• Create the activity

• AndroidManifest.xml

• The Java fun begins!

• actually writing the first activity

• Persisting stuff with SQLite

• Accessing lists with Adapters

• HTTP-Calls

• Adding a MenuFreitag, 15. Oktober 2010

Page 25: Android Workshop at @majug by @derwildemomo and @elektrojunge

Things to keep in mind• Have a good user experience!

• Pay attention to the UI!

• Think about performance!

• Avoid object allocation (use static final attributes, avoid collections,...)!

• Consider different target devices!

• Pay more attention to the UI!

Freitag, 15. Oktober 2010

Page 26: Android Workshop at @majug by @derwildemomo and @elektrojunge

The Android Market• Register as a developer for $29 using Google

Checkout and agree to the license

• ~80.000 Apps (and growing)

• Not available worldwide but increased availability

• Significantly more free apps than paid ones (numbers vary, though)

• Needs a google account AND „google checkout“ for paid apps

• Alternative markets?

google checkout und paypal?

Freitag, 15. Oktober 2010

Page 27: Android Workshop at @majug by @derwildemomo and @elektrojunge

Other interesting stuff• Google Developer Events (not only on

Android) & Android Barcamps

• It‘s hard to get info directly from Google (improvements planned)

• User groups (www.gtugs.org) & Android Meet-ups

• Fragmentation Issues?!

• Patent problem (Oracle‘s lawsuit)?!

• Piracy problems?!Freitag, 15. Oktober 2010

Page 28: Android Workshop at @majug by @derwildemomo and @elektrojunge

Some advertiseing

There‘s the 1st event using „our new name“

Stuttgart GTUG2.11.2010, 18h, Android Tech Talks

Location: DHBW Stuttgart, Stuttgart-Mitte

Website: www.gtugna.gtugs.org

Freitag, 15. Oktober 2010

Page 29: Android Workshop at @majug by @derwildemomo and @elektrojunge

Thanks!

and now: Q&A!

Freitag, 15. Oktober 2010