1

I am trying to implement some extra feature onto the wikitude sample project

What I tried is the following: I have button ("Take me there") in Poi detail panel near the "More" button and when user clicked to the "Take me there" button, I want to call a java method to do some calculation.

in my js file on button click method I have:

var currentMarker = World.currentMarker;
var architectSdkUrlm = "architectsdk://navigation?id=" + encodeURIComponent(currentMarker.poiData.id) + "&title=" + encodeURIComponent(currentMarker.poiData.title);
document.location = architectSdkUrlm;

where "Navigation" in the architectSdkUrlm is name of the java class that I created for the calculations. Navigation class is:

public class Navigation extends AbstractArchitectCamActivity  {

    @Override
public ArchitectView.ArchitectUrlListener getUrlListener() {
    return new ArchitectView.ArchitectUrlListener() {

        @Override
        public boolean urlWasInvoked(String uriString) {
            Uri invokedUri = Uri.parse(uriString);

            // pressed "Take me there" button on POI-detail panel
            if ("navigation".equalsIgnoreCase(invokedUri.getHost())) {
                Log.d("title",String.valueOf(invokedUri.getQueryParameter("title")) );
                /*final Intent navIntent = new Intent(Navigation.this, navigationIntent.class);
                navIntent.putExtra(navigationIntent.EXTRAS_KEY_POI_ID, String.valueOf(invokedUri.getQueryParameter("id")) );
                navIntent.putExtra(navigationIntent.EXTRAS_KEY_POI_TITILE, String.valueOf(invokedUri.getQueryParameter("title")) );
                Navigation.this.startActivity(navIntent);*/
                return true;
            }

            return true;
        }
    };
}
}

I want to see if I could call the java file from js by a Log message but I don't get anything.

Do you have any idea about what might be the problem?

Thanks.

user997248
  • 73
  • 2
  • 10
  • From point of interaction between java and javascript it looks good. Make yourself totally sure that you call document.location line. – Yevgen Nov 18 '15 at 20:44

0 Answers0