Search code examples
javascriptandroidcrosswalk-runtimecrosswalk

How to get data into crosswalk from Android


I know we can get data from the Crosswalk HTML into android and toast it. But I have data from Android that I'd like to pass to the Javascript running in Crosswalk View. Any way to work around this ?

like using the gyroscope feed straight into the HTML or even bluetooth data?


Solution

  • Got it, @JavaScriptInterface was used to call a function in native. So write a native function to return a String back to the javascript code on your html. For some weird reason returning int isnt working but strings work fine.