Android interacting with HTML5 tutorial?
I've been looking at using a WebView to display an HTML5 webpage, where the novel features of the mobile device (GPS, compass, accelerometer, camera, etc) can be fed back into the web page.
I was wondering if there were any good tutorials showing t开发者_如何学运维hese functions interacting with the webview.
So far I've found ways for the WebView to send javascript commands to the web page, but those interactions haven't been triggered from outside the web view (such as upon receiving an intent from the GPS or accelerometer).
Note: The HTML5 Geolocation API is not what I'm interested in. I'm interested in the web page <-> WebView interactions, as noted here: http://android-developers.blogspot.com/2008/09/using-webviews.html
Here is a sample project showing feeding a location into a WebView
's Javascript.
精彩评论