(Android)
You could script an "event proxy" that is started onLoad by attaching a Javascript interface to your WebView, here's some pseudocode:
[...]
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.addJavascriptInterface(new JavaScriptInterface(), "android");
mWebView.loadUrl("file:///android_asset/www/index.html");
}
final class JavaScriptInterface {
JavaScriptInterface () { }
public void startEventProxy() {
// capture and pass shake events to javascript
}
}
(iPhone)
You can interface with the Device Motion API, available in Safari Mobile.
http://plugins.jquery.com/project/tilt