development of a mobile app for android

24
Development of a mobile app for Android Alex Reid SuperMondays, February 2010

Upload: others

Post on 18-Dec-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

Development of a

mobile app for Android

Alex Reid

SuperMondays, February 2010

Alex Reid

Sorry, not the cage fighter

I’m a software developer

Lead development of a projects database here at the

University since 2006.

Mobile development

Android mainly but also iPhone and BB

Content

Overview of mobile apps

How you write a mobile app

Differences from web

Mobile device constraints and benefits

Android

Live coding an app from scratch

Mobile AppsLots of us carry small

computers around with us

Software development kits allow anyone to write apps for these devices

Some great ... some erm.

Easy distribution through AppStores

Ask the HoffI did the Android port

of this iPhone app

by Never Odd or

Even LLP

Shake your phone for

wisdom from DH

Featured on Radio 1

Available on AppStore

and Market - 59p

Next MetroWe’ve put the Metro

timetable inside your Android or iPhone

Tells you how long the next train at your stop will be

Updated from web service when online

With Never Odd. In discussions with Nexus

How to write an app

Decide which device(s) to target

Download, learn and use the SDK

Test your code on an emulator

Publish

Watch the money roll in

What’s in an SDK?

Libraries

IDE integration (Eclipse, XCode)

Frameworks

Simulators / Emulators

Utilities

Documentation

Differences to web

Less of everything - speed, network, storage, memory & screen real estate

Event driven (Flash, Desktop)ThreadingCrash means the process diesNo cross browser differences :)

Cross device differences though :(APIs can and do change

Be efficient

Think about battery lifeBad code - device turns into a hand warmerApp must be a good multitasking citizenOffload data crunching to a serverAssume networks are slow / transient

Recover gracefully. Don’t hang.

Remember

Emulator can be much faster than device

Phone models vary in speed and spec

Avoid object creation, reuse UI widgets

static, int vs Integer, [ ] vs List<T>, getters...

Load things only when you need them

Careful with compressed media

Watch application size (192MB on Android)

Android

A mobile operating system

Uses a modified Linux kernel

Not a Linux distro

Apps are written in Java

Apps don’t run as Java - Dalvik VM

Open source: vendors customise it

Android stack

Why Android?

Range of Android devices / vendors

Rich SDK - free to download and use

Available for Mac, Windows and Linux

Low barrier to entry

Java widely used; easy for C# devs

iPhone very Mac centric

SDKs FTW

Fantastic building blocks ... leverageRich library of UI controls and widgetsWebKitSQLite3 relational database engineMapsOpenGLHardware: Compass, GPS, Accelerometer

Android Tools

Eclipse 3.5 with Android Developer Tools

Well supported and feature rich IDE

UI design

Debugging

Testing

Deploy to emulator and device (via USB)

Publishing and signing wizards

Jargon

Apps consist of at least one screen or Activity

Activities are linked via Intents

Services are faceless and run indefinitely

Content providers make your app’s data available to other

apps

content://org.yourapp/people/Alex

Live coding demo

We’re going to construct an app that plays a

sound when you press a button

Not a Java tutorial

Just to give you an idea

But by all means ask later or email me

Sad Trombone

Every office needs this app!

Add a button

Add code so it responds to clicks

Attach code to play a sound

Fix some bugs

Deploy it to a device

Any questions?