2. Thorsten Rinne
Senior Developer - Team Lead - Head of Open Source Labs
‣Diplom-Informatiker (FH)
‣Zend Certified Developer
‣Certified Scrum Master
‣PHP since PHP 3.0.16
‣phpMyFAQ since 2001
iPhone Apps with HTML5 I Mayflower GmbH I June 12th 2010 I
3. Blackberry? Android?
iPhone!
Palm Pre?
iPhone?
Maemo?
Windows Mobile?
iPhone Apps with HTML5 I Mayflower GmbH I June 12th 2010 I
4. Why iPhone?
iPhone Apps with HTML5 I Mayflower GmbH I June 12th 2010 I
5. Why iPhone?
Sales volume mobile apps in 2009
Android Market & Co.
1%
App Store
99%
Daten: Gartner
iPhone Apps with HTML5 I Mayflower GmbH I June 12th 2010 I
6. 400x more sales in App Store
than in Android Market.
Daten: Gamneloft
iPhone Apps with HTML5 I Mayflower GmbH I June 12th 2010 I
27. Beep, Vibrate and Alert
function onAlertButton()
{
! navigator.notification.alert("Message","Title", "Label");
}
function onVibrateButton()
{
! navigator.notification.vibrate(100); // not supported by
iPhone
}
function onBeepButton()
{
! navigator.notification.beep();
}
iPhone Apps with HTML5 I Mayflower GmbH I June 12th 2010 I
28. Demo
Geolocation
iPhone Apps with HTML5 I Mayflower GmbH I June 12th 2010 I
29. Geolocation
function getCurrentLocation()
{
! $('#location').append = "Get current position ...";
! var funk = function(position)
! {
! $('#location').append = "Latitude: " +
position.coords.latitude + " Longitude: " +
position.coords.longitude;
! };
! var fail = function(error)
! {
! ! alert("Error " + error);
! }
navigator.geolocation.getCurrentPosition(funk,fail);
}
iPhone Apps with HTML5 I Mayflower GmbH I June 12th 2010 I
30. Demo
Play & Record
iPhone Apps with HTML5 I Mayflower GmbH I June 12th 2010 I
31. Play ...
function playRecord()
{
if (navigator.audio) {
$('#play-button').attr('src','stop.png');
navigator.audio.play();
} else {
alert("No audio file found.");
}
}
iPhone Apps with HTML5 I Mayflower GmbH I June 12th 2010 I
32. Record ...
function startRecord()
{
navigator.audio = new Media(null, recordingSuccess, recordingFailure);
$('#cd-button').attr('src','cd.png');
navigator.audio.startAudioRecord();
navigator.notification.activityStart();
$('#record-button').attr('src','stop.png');
navigator.audio.startAudioRecord();
}
function stopRecord()
{
$('#record-button').attr('src','record.png');
navigator.notification.activityStop();
$('#cd-button').attr('src','cd_remove.png');
navigator.audio.stopAudioRecord();
}
function recordingSuccess(url)
{
navigator.notification.activityStop();
// Tu etwas
}
function recordingFailure(error)
{
navigator.notification.activityStop();
alert("Aufnahme fehlgeschlagen: " + error);
}
iPhone Apps with HTML5 I Mayflower GmbH I June 12th 2010 I
33. Questions?
iPhone Apps with HTML5 I Mayflower GmbH I June 12th 2010 I