Start a new topic

Android Studio this.architectView.load() not work

Android Studio this.architectView.load() not work


Hi everybody, 

I?m writing in reference to a problem with use wikitudeSDKSample 3.2.1 in Android Studio 1.5 and 2.0

I searched in wikitude forum and in stackoverflow but i can't resolve it.

When I call this.architectView.load();  this not work with a local file, but it works with http://wikitude.world.url.com.










I try use:





this.architectView.load("file:///android_asset/index.html");



this.architectView.load("android_asset/index.html");

this.architectView.load("android_assets/index.html");

this.architectView.load("assets/index.html");

this.architectView.load("index.html");

this.architectView.load(getActivity().getAssets().openFd("file:///app/src/main/assets/index.html").toString() );

this.architectView.load(getContext().getAssets().openFd("file:///app/src/main/assets/index.html").toString() );

but no one works.

The index.html is in assets folder created by android studio, the structure is:




assets


assets (it contains pictures, i tryed change name, but nothing is changed)

css

jquery

js

ade.js

index.html




In my build.grandle file I have:

sourceSets { main { assets.srcDirs = } }

Can you help me to find a solution of this problem?



Thanks in advance






 

 

 

Hi Serena,

Please have a look at the provided Sample application, which also uses relative paths within the assets folder. Calling architectView.load("index.html") will load file from application's assets folder and architectView.load("yourpath/index.html") the index html-file in yourpath, relative to the assets root directory, no need to use absolute assets-directory.

There may even be an error in your JS code. Have you tried loading it from assets root folder? Please first try loading a valid sample application and then replace it with your own source code.

Also have a look at Android remote dubugging to find potential JS errors.

I hope this helps

Hi Eva,

thanks for your answer! I checked my project and I understand that the index.html is loaded, but the radar, the markers and the footer aren't show in architectureView.  I tried to check project with Android remote debugging, but it not show any error. I have AR.radar.enabled=true; What else can i check?

Thanks again.

Hello Serena,

If you are able to load the Architect World from a server then you should also be able to load it locally. I would suggest you do the following. First, have a close look at the relative path you are using for storing the files locally and make sure that they are correct. In addition, you can also have a look at our sample code to see exactly how the Architect World is loaded locally there.

Thanks

HiEva,

thanks for your reply, now index.html is loaded! :) but I can't see any AR objects. I tried bedug it with  Android Remote Debugging, the structure of page is correct but the radar isn't showing.

I think the problems may be that:

1) the Location is null 

2) the urlListener contains  com.example.XXX.EEE and not "architectsdk://foo?bar=123"

What do you think about this?

Thanks again

 

 

Hi Serena,

I suggest you start with our samples and then try to adjust them, by adding or removing functionality, so that you can start creating your own app.

Thanks
Login or Signup to post a comment