05/2013
(Fil Maj)
Master Exploder @ Adobe
Work on all things PhoneGap, mobile, web and beer
@filmajNative mobile apps built with HTML5
cordova.exec();
Code Ahead
cordova.exec();
cordova.exec(win, fail,
service, action, args);
win
: success callbackfail
: failure callbackservice
: native class that will do the workaction
: native method that will do the workargs
: arguments to pass into native methodRoutes JavaScript exec
to native code
<plugin name="SERVICE!" value="native class identifier"/>
e.g. (Android)
<plugin name="Accelerometer"
value="org.apache.cordova.AccelListener"/>
<plugin>
is loaded first
deviceready
is fired and WebView is showncordova.exec
are routed to appropriate class
Let's write JavaScript for the simplest plugin: Echo.
plugin.xml
describes:
(Un)installs plugin.xml-ready PhoneGap Plugins
Supports Android, iOS, BlackBerry 10
https://github.com/phonegap-build
Plugins available on Adobe's PhoneGap Build service using this!