5. Questions To Ask for Mobile
•
How does my solution:
•
Affects battery life ?
•
Affects network traffic ?
•
Deal with interruptions ?
•
Deal with connectivity ?
•
Respects user’s privacy ?
15. Hybrid Apps +
•
Most of the app is written once
•
Only native parts are written again and again
•
“Feels” native
•
Developer controls native code => can use native
APIs
16. Hybrid Apps •
Complex code
•
Requires knowledge in many programming
languages
•
Data is transferred between environments
•
Hard to debug
17. Let’s Analyse A Hybrid App
•
Hystagram is a hybrid
version of instagram with
minimal functionality
•
Supports:
•
Taking photos
•
Watching photos
•
Uploading photos to
server
20. Processes and scopes
Process
Take a photo
Upload photo to server
View photo stream
Scope
Why
Native
Need to show a camera
overlay
Native
Upload must continue
when app is not active
23. Introducing Phonegap
•
An open source connection layer between web
content and native
•
Extensible
•
Supported platforms:
iOS, Android, Blackberry, WebOS, Windows
Phone, Symbian, Bada
39. What You Should Use
•
For web clients, cookies are the easiest
•
If possible, prefer to store only session id in the
cookie
•
For other clients, consider a token
60. Using The Camera
•
iOS >= 6; Android >= 3
•
<input type="file" field opens camera app
Normal <input> capture="camera" accept="image/*"
id="takePictureField">
61. What You Can Do
•
Take a picture and send it to server
•
Analyse picture on the client - Demo
•
Apply filters or edit - Demo
62. What You Still Can’t Do
•
Can’t check if camera is available
•
No camera overlay
65. Video Tag
•
HTML5 introduces a <video> tag to embed
videos in a web page.
•
Different browsers support different video
formats. The <video> tag can specify multiple
formats.
66. Video Formats
•
Video formats are like
languages
•
The same video can be
encoded in different
formats
•
A browser must “speak the
language” to be able to play
the video
70. Limitations: Autoplay
“ Apple has made the decision to disable the
automatic playing of video on iOS devices,
through both script and attribute
implementations.”
Issue 159336:
On Android, html5 video autoplay attribute
does not work.
71. Limitations: Play Inline
“ Currently, Safari optimizes video
presentation for the smaller screen on
iPhone or iPod touch by playing video using
the full screen
”
Videos play inline for Android >= 3
84. Audio API: What You Can Do
•
Apply audio filters (using filter nodes)
•
Change volume (using gain nodes)
•
Merge multiple audio sources to one destination
•
Play with accurate timing
85. Audio API Demo
•
Same game as before
•
This time no delays in playing the audio
•
More complex demo:
http://labs.dinahmoe.com/ToneCraft/#
107. Photos Used In The Slides
•
Choices (slide 6):
http://www.flickr.com/photos/danmoyle/
11715566974/sizes/l/
•
Man with camera (slide 43):
http://bit.ly/1gb5ZZM