Start a new topic

Passing parameter to index.html

Passing parameter to index.html


How do i pass parameters while loading the ArchitectView? I need to pass the imagepath url to index.html for image overlay. I tired the following which doesnt work.

Method 1: this.architectView.load("arviews/ImageOnTarget/index.html?imagePath=testing");

Method 2:


String myOtherUrl =
"arviews/ImageOnTarget/index.html?imagePath=" + URLEncoder.encode(imagePath, "UTF-8");
Log.e(this.getClass().getName(), " myOtherUrl:"+myOtherUrl);

this.architectView.load(myOtherUrl);

}



Method 3:

this.architectView.load("arviews/ImageOnTarget/index.html?imagePath=http%3A%2F%2Fwww.ikea.com%2Fca%2Fen%2Fimages%2Fproducts%2Fkivik-loveseat-and-chaise-lilac__0252355_PE391172_S4.JPG");
Or


this.architectView.load("arviews/ImageOnTarget/index.html?imagePath=http://www.ikea.com/ca/en/images/products/kivik-loveseat-and-chaise-lilac__0252355_PE391172_S4.JPG");

 

Output:

08-06 20:19:13.243    3500-3507/com.wikitude.virtualhome W/art? Suspending all threads took: 5.372ms

08-06 20:19:13.243    3500-3500/com.wikitude.virtualhome I/Timeline? Timeline: Activity_idle id: android.os.BinderProxy@91af8e9 time:8769198

08-06 20:19:13.273    3500-3500/com.wikitude.virtualhome I/chromium? "Uncaught ReferenceError: AR is not defined", source:  (1)

 

 

Hi Swentha,

Passing parameters when html is in assets-folder is not supported by Android (compare e.g. stackoverflow)
You need to use architectView.callJavaScript() to inject your values or host html on a server to pass params via url.

Best regards,
Andreas

Thanks Andreas.

Got it working with calljavascript().
Login or Signup to post a comment