Start a new topic

Help with Java and Javascript

Help with Java and Javascript


Hi, im new on Android and i have one question.

Can i call a Java Class Attribute from my Android App on Javascript? How?

Thanks
 

Please have a look at the SDK sample app - Browsing POIs / Native POI detail page.
The urlListener in Android and the document.location = "architectsdk://yourcommand" will do the job for you.

Sources are bundled in the SDK's zip file, documentation is also available online.

I put in my javascript code this:

var architectSdkUrl = "architectsdk://scorerSelected?score=" + encodeURIComponent(valor) + "?title=" + encodeURIComponent(World.id);
document.location = architectSdkUrl;

 

And in my RAActivity this:

public boolean urlWasInvoked(String uriString){
Uri invokedUri = Uri.parse(uriString);
if("scorerSelected".equalsIgnoreCase(invokedUri.getHost())){
...
}

 

but it doesn´t work.

Am i not doing something? Thx

Please use Android debugging and remote webview debugging to figuer out where the issue is.
I'd log the "architectSdkUrl" in your JS environment and the "invokedUri.getHost()" value in native code.
Login or Signup to post a comment