Start a new topic

ArchitectView.load - unable to use file system

ArchitectView.load - unable to use file system


Hey guys,

I'm using dynamic content in my app, so i need to load world from file system instead of assets.

If i use URI file:///data/data... i see that ArchitectView loaded file:///android_asset/file:///data/data instead.

If i give simple /data/data.. path then ArchitectView loaded file:///android_asset//data/data.

How should i call architectView.load to point to app cache dir or some absolute file system path?

Thanks,

Ernest

Loading architect-world is currently only supported when files are stored in asset folder or a webserver.
We are working on this feature, unfortunately there is no "workaround" for this available.

Kind regards,
Andreas

Just to say I could really do with this functionality too.

Cheers

Hi Peter!

Some good news for you: Upcoming SDK version will support the feature you requested. Stay tuned, Wikitude SDK 3.2 it will be available very soon in the download section. You can then open a World using "file:///...", "http://" or even just "index.html" to open a World from your project's assets-folder.

Kind regards,
Andreas

I'm using this feature but i think there is something wrong.

I'm working on android and I've copied all my assets to /data/ 

If i try to:

app.loadARchitectWorld("file:///data/index.html");

It doesn't work. It opens the AR view with an error about opening file:///data/index.html

 

Instead, if i use this format:

app.loadARchitectWorld("file:///storage/sdcard0/" + Cms.assetsDir + "/index.html");

It opens correctly the index page, but, when i tries to open a resource (for example a sound), with:

        var x_audio = new AR.Sound("assets/audio/x.mp3", {

            onLoaded : function(){

                console.log( " - x sound loaded" );

                AR.logger.error(" - x sound loaded");

            },

            onError : function(){

            // alert the user that the sound file could not be loaded

                console.log( "error " );

                AR.logger.error("error ");

            }

        });

 

It says:

 


03-24 18:49:57.390: D/chromium(12091): Unknown chromium error: -6

03-24 18:49:57.562: I/ArchitectWebView(12091): file:///storage/sdcard0/data/assets/audio/x.mp3 (file:///storage/sdcard0/data/assets/audio/x.mp3)

03-24 18:49:57.562: I/ArchitectWebView(12091): Media reported error: file:///storage/sdcard0/data/assets/audio/x.mp3

 

Viewing in a file exporer, /storage/sdcard0/data/assets/audio/x.mp3 exists.

 

What am i doing wrong?

Thanks

 

Hi Roberto!

Please keep in mind that the path to the SD-card is not the same on all Android devices. Using

Environment.getExternalStorageDirectory();

is the most common way to get it in native Android. PhoneGap has some other approach to fetch that information.

As written in one of my previous posts it is therefore not recommended to use absolute paths in your AR experience, also note that "assets" may be a keyword in WikitudePlugin and be internally replaced by "Android's assets folder path", so try using some other folder-name.

Kind regards,
Andreas

Hi Andreas,

i'm using absolute path because of this ( https://support.wikitude.com/support/search/topics?term=Accessing+files+from+SD+Card+then+load+in+ARchitect ).

I know that i don't retrieve automatically the path, but it's not the point ( i will add obviously ).

The issue is about the impossibility to load AR objects when they have been moved to the sdcard. AR World works, AR objects doesn't.

I've tried with different folder name but the result is the same.

If i don't move the project on the SD all works flawlessly.

 

I'm using wikitude from a phonegap: could it be the issue?

Are you sure it isn't a bug on the sdk? (It's a fresh feature i guess)

EDIT: i found in the release notes of version 3.2 this line 


Images can be loaded from any source


But it's avaiable only for images? Because i moved all my asset to the sdcard, and my error is releated to a sound, maybe it's the issue? Let me know, it's very important: all my current project is based on this feature.

Thanks in advance.

 

Hi Roberto!

We'll having a look at your finding. It would be great if you can provide us an html/js where issue is reproducible, so we have something to provide devs to start with and test against once fixed, in case it is a real SDK issue.

Sending the sample sources to android (at) wikitude.com is very appreciated.

Thanks in advance.

Ok, i've already sent you and email with the sample project.

Let me know how the test proceed.

A fix for this should be in the version we will be releasing next week. Just check our website and the developer newsletter and please test with it once it is avaiable, reporting back any issues. Thanks again for reporting the issue.
Login or Signup to post a comment