btw, Sweden rocks
it's so gorgeous here!
as a (Vancouver) hockey fan... thank you

| z, ? | toggle help (this) |
| space, → | next slide |
| shift-space, ← | previous slide |
| d | toggle debug mode |
| ## <ret> | go to slide # |
| c, t | table of contents (vi) |
| f | toggle footer |
| r | reload slides |
| n | toggle notes |
| p | run preshow |

Filip Maj Nitobi


how many web devs here?



image actually not a bad idea, talk a bit about how each platform implements

PhoneGap.exec(class, method, win, fail, arguments)
// We catch urls of the following form on
// native side:
gap://class + '/' + method + '/' + arguments
// We get this method on the WebView:
evaluateJavascriptFromStringByStringAndMakeThisMethodNameAsVerboseAsPossibl
WebView.loadUrl("javascript" +
":alert('android only!');");
WebView.addJavascriptInterface(
/* arbitrary Java object */);
Samsung and Motorola made changes to their webview codebase in mystical ways

loadUrlWebView.loadUrl used to trigger JavaScript from Android JavaloadUrl hides the soft keyboard
addJavascriptInterfaceinterestingly parts 1 & 2 started becoming problems around the same time, and they are each a method in JS -> native communication
addJavascriptInterface goes the other way: JavaScript to Java

prompt(this.stringify(args),
"gap:"+this.stringify([service,
action, callbackId, true]));
package com.phonegap.plugintest
import com.phonegap.*
public class MyPlugin extends Plugin
// ...
@Override
public PluginResult execute(String action,
JSONArray args, String callbackId)
navigator.app.addService("com.phonegap.plugintest.MyPlugin",
"MyPlugin")
// ^^^ will dynamically instantiate your native plugin class
function myPlugin() {};
myPlugin.prototype = {
doStuff:function(win, fail, argument) {
PhoneGap.exec(win, fail, "MyPlugin",
"someAction", argument);
}
}
document.addEventListener("backbutton",
function() { alert('back!'); }, false);
"backbutton""menubutton""searchbutton""homebutton" :)<menu> spec in PhoneGapwhen changing flag, behaviour is similar to iOS 4 tombstoned apps; JS timers and other such tasks are paused
document.addEventListener("pause",
function() { alert('paused!'); }, false);
"resume"please help!

