2. 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
3. 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
4. Mobile Apps
• Lots 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
5. Ask the Hoff
• I 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
6. Next Metro
• We’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
7. 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
8. What’s in an SDK?
• Libraries
• IDE integration (Eclipse, XCode)
• Frameworks
• Simulators / Emulators
• Utilities
• Documentation
9.
10.
11.
12.
13. Differences to web
• Less of everything - speed, network,
storage, memory & screen real estate
• Event driven (Flash, Desktop)
• Threading
• Crash means the process dies
• No cross browser differences :)
• Cross device differences though :(
• APIs can and do change
14. Be efficient
• Think about battery life
• Bad code - device turns into a hand
warmer
• App must be a good multitasking citizen
• Offload data crunching to a server
• Assume networks are slow / transient
• Recover gracefully. Don’t hang.
15. 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)
16. 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
18. 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
20. 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
21. 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
22. 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
23. 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