Start a new topic

Connection between native code and javascript

Connection between native code and javascript

1 person has this problem


Hi there!

Please have a look at the latest SDK Version and find updated Android documentation in the devzone. Recently introduced "AbstractArchitectCamActivity.java" and "AbstractArchitectCamFragmentV4.java" describe the interaction between JS and native code in more detail. "SampleCamContentFromNativeActivity.java" demoes how to pass information from your Android code into JS. 

Kind regards,
Andreas

Hi , I wanted to ask about the way we connect native code and javascript code. in "Presenting POI Destails(1/4)" it says :

"The World.onMarkerSelected function is called when a marker is clicked.

onMarkerSelected: function onMarkerSelectedFn(marker) {
// notify native environment
document.location = "architectsdk://markerselected?id=" + marker.poiData.id;
}

The document.location = architectsdk://... call is handled in native code's urlListener, where the passed id is used to call the right POI detail page."

I didn't understand where the native code listens to this javascript event. in "SamplePOIdatafromNativeActivity" I didn't find any code related to this . I'll appreciated if you can help me with this .

thanks
Login or Signup to post a comment