Coursework 2 implementation options Chris Greenhalgh G54UBI / 2011-03-02 1Chris Greenhalgh...
-
date post
15-Jan-2016 -
Category
Documents
-
view
213 -
download
0
Embed Size (px)
Transcript of Coursework 2 implementation options Chris Greenhalgh G54UBI / 2011-03-02 1Chris Greenhalgh...

Chris Greenhalgh ([email protected]) 1
Coursework 2 implementation options
Chris GreenhalghG54UBI / 2011-03-02

Chris Greenhalgh ([email protected]) 2
Contents
• Target device(s)• Implementation options– Supported: Google AppInventor, HTML/JS,
PhoneGap, Android Java (native) App– Unsupported: Titanium mobile, other native app
• Sensor options• Summary

Chris Greenhalgh ([email protected]) 3
Target device(s)
• Android is the only supported target platform– Freely available tools– Freely available
emulators

Chris Greenhalgh ([email protected]) 4
Implementation options…
Supported• Google AppInventor• HTML/JS Browser App• PhoneGap• Android native (java) app
Unsupported• Titanium mobile• Other native app

Chris Greenhalgh ([email protected]) 5
Option 1: Google AppInventor
• Creates simple Android apps– Drag’n’Drop UI builder– Scratch-like visual
programming
• Web tool plus local tools (JNLP)– Requires Google account
http://appinventor.googlelabs.com/about/

Chris Greenhalgh ([email protected]) 6
Option 2: HTML/JS Browser App
• Dynamic web pages – HTML layout– CSS styling– JavaScript behaviour
• Compatible with many devices– Limited low-level/sensor
access
• Various tool(s)– E.g. Eclipse

Chris Greenhalgh ([email protected]) 7
Option 3: PhoneGap
• Converts HTML/JS apps to installable phone apps
• Compatible with many devices– Better low-level/sensor
access– Option for native
extensions
• Requires app build – Eclipse for Android
http://www.phonegap.com/

Chris Greenhalgh ([email protected]) 8
Option 4: Android Native (Java) App
• Creates Android apps– OO Java framework
specific to Android– Limited DnD UI builder
• Complete access to device APIs, sensors, …
• Requires Eclipse IDE plus Android SDK and Eclipse plugins
• Only suitable for experienced developershttp://developer.android.com/
LIMITED SUPPORT

Chris Greenhalgh ([email protected]) 9
Other option: Titanium Mobile• Creates mobile apps
– All programming in Javascript– Custom (native) widgets– Converted to installable App
(similar to PhoneGap)
• Compatible with Android and iPhone– Good low-level/sensor access– Option for native extensions
• Simple desktop GUI project management/build tool– plus your own choice of JS
editorhttp://www.appcelerator.com/products/titanium-mobile-application-development/
NOT SUPPORTED

Chris Greenhalgh ([email protected]) 10
Other option: Other native app
• E.g. iPhone/iOS• Creates app for that
target– Platform-specific
development
• Complete access to device APIs, sensors, …
• Platform-specific tools
NOT SUPPORTED

11
Implementation SummaryAppInventor Browser PhoneGap Native Android
Support Yes Yes Yes Limited
Installable / standalone app
Yes No Yes Yes
GUI DnD editor HTML/CSS HTML/CSS Java/XML
Logic Visual programming
Javascript Javascript Java2 (Android framework)
GPS Yes1 Yes Yes Yes
Other sensors Compass, Accelerometer, barcode, photo
- Compass, Accelerometer, barcode, photo
Compass, Accelerometer, barcode, camera, …
Map view Limited2 Yes Yes Yes
Networking Limited HTTP HTTP HTTP, TCP, …
Android Yes Yes Yes Yes
iPhone No Yes Yes (requires Mac OS-X)
No
Easier
Easy transition1 Limited options for region logic2 By switch to map app (no overlay)
Chris Greenhalgh ([email protected])

Chris Greenhalgh ([email protected]) 12
Sensor options
Supported• GPS
– Lat/long– Regions
• Compass• Accelerometer• 2D barcode• Remote sensors
– Environmental
Unsupported• Remote sensors
– Interactive/installation
• Photo• Continuous camera input• Network scanning
– Bluetooth, WiFi
• NFC / RFID

Chris Greenhalgh ([email protected]) 13
GPS lat/long
• Outdoor position– Requires view of sky
• Typically 5m accuracy• Updates once/second• Takes up to a minute
(sometimes more) to get initial “fix”

Chris Greenhalgh ([email protected]) 14
A note on network location providers
• iPhone and Android also support location from network information– GSM cell, WiFi networks
• Requires network lookup (online)
• Very rough position– 10s metres (urban) –
1000s metres (rural)

Chris Greenhalgh ([email protected]) 15
GPS regions
• Classification of GPS position in terms of “meaningful” regions– E.g. “near the statue”
• Depends on GPS fix & accuracy– Classified at run-time
• Requires region geometry to be pre-specified

Chris Greenhalgh ([email protected]) 16
Compass
• Many phones contain a 1, 2 or 3-D magnet flux compass– Gives approximate
orientation (heading)– Affected by nearby
ferrous objects– Native Android apps may
get pitch and roll as well as heading (azimuth)

Chris Greenhalgh ([email protected]) 17
Accelerometer
• Monitors 3D acceleration of device– Acceleration = rate of
change of velocity– Gravity = 9.8ms-2 (down)

Chris Greenhalgh ([email protected]) 18
2D Barcode
• Several standards for encoding data (esp. URLs) as 2D barcodes– E.g. QR Code
• Supported by standard reader apps using camera– E.g. ZXing for Android
• Can be generated and placed to identify – Specific objects– Places– People
http://www.cs.nott.ac.uk/~cmg/

19
Remote sensors
• Network access to remote sensors– E.g. Phidget Single Board
Computer w.
• Embedded in environment*– E.g. Temperature,
humidity, light
• Interactive installation– E.g. Touch, distance,
pressure, force, …
IR Distance
IR Reflective
Vibration
Force
Magnetic
Rotation
Touch
Motion (PIR)
Slider
Mini-joystick
pressure
Voltage
current
temperature
Temp & humidity
light
sonar
ID distance
* One set of sensors will be installed at the edge of the CS Atrium for test/development
NOT SUPPORTED

Chris Greenhalgh ([email protected]) 20
Sensor summaryAppInv PhoneGap Emulator Device(s)
GPS lat/long Yes Yes Yes (no accuracy) Most
GPS region Limited Yes Yes Most (GPS)
Compass Yes Yes No Most
Accelerometer Yes Yes No Many
2D barcode Yes1 Yes1 No2 Most (Camera)
Remote sensors Yes3 Yes3 Yes4 All (network)
1: requires ZXing app2: a work-around might be possible using an alternative app (TBD)3: requires bridging service (for AppInv specifically as WebTinyDB)4: remote sensors are outside the emulator (emulating the remote sensors is another matter)

Chris Greenhalgh ([email protected]) 21
Conclusion
• First:– Identify the target platform (default Android)– Identify the implementation approach you will use
• Taking account of technical skills/background plus interests and platform capabilities
– Identify the sensor(s) that you will use• Bear in mind emulator support and your options for
access to real device(s)
• Scope/refine your coursework 2 concept accordingly