Log in or register to post comments

Loading Datasets from external scources

May 3, 2012 - 6:38am #1

Hello everyone,

Is it possible to load in datasets and trackables from external paths? I have tried including datasets into Unity3D Asset Bundles, but Unity doesnt allow *.dat files to be included into Asset Bundles.

What I am looking for is a way to download the dataset and trackable images from external scource, as it is for a variable app.

Thanks in regards,
Morgaza

Loading Datasets from external scources

July 2, 2017 - 9:50pm #15

Hello,

Did someone got this work?

What I got is actually the dataset are loaded, but the not the database

I load the dataset from the persistentDataPath 

 

or maybe now we can't load datasets from external source anymore?

 

thanks

Loading Datasets from external scources

October 8, 2015 - 3:01am #14

Morganza you can send me the script for this? I can not make it work..

Loading Datasets from external scources

July 20, 2012 - 7:18am #13

Hi junkiehead,

This is really an application specific question, as only you know the use case and its frequency.

This is probably the type of use case that the new Cloud REco would support, and it's hard to try and circumvent the existing solution to make it do what you want.

https://ar.qualcomm.at/content/vuforia-web-services

You will probably need to try several solutions and then test out in the field.

N

Loading Datasets from external scources

July 20, 2012 - 12:32am #12

Hi all

I am loading dataset from server for my ios app.

My present way is that I am downloading the new .dat and .xml for new images everytime.

But I want to do it for only new images. So I need to put a timestamp on the existing dataset and ask only for the dataset of images post that date.

I have to keep images for last 7 days.

So how should I fetch new dataset??

What I felt was

First lets do matching with existing dataset(one which is on device) and then if the matching fails a request will go to server for the dataset which is post that date but are less than 7 days old.

i will download this new dataset.

name it as a new dataset and match with this one.

Is this a good way of saving network time of download.(now user download only those image datasets which required.)

Pls help moderators

Regards()

Re: Loading Datasets from external scources

May 15, 2012 - 6:45pm #11

That's a good idea.

Re: Loading Datasets from external scources

May 15, 2012 - 2:09pm #10

Yes, that was the solution, thanks a lot!

Maybe it would be handy if that example would be included in the development guide!

Re: Loading Datasets from external scources

May 14, 2012 - 10:20pm #9
Quote:

First off, do I need to save the XML file along with the DAT file?

Yes, both files need to be saved side-by-side.

Quote:

Then attempt to find it using:

DataSet.Exists(Application.persistentDataPath + "/Main", DataSet.StorageType.STORAGE_ABSOLUTE);

but that returns false.

Try adding the ".xml":

DataSet.Exists(Application.persistentDataPath + "/Main.xml", DataSet.StorageType.STORAGE_ABSOLUTE);

- Kim

Re: Loading Datasets from external scources

May 14, 2012 - 1:44am #8

Allright, I got to the point where I can save the files on my mobile, but I have a few questions, as it doesnt work yet.

First off, do I need to save the XML file along with the DAT file?

Then secondly, how would I load the file into the plugin?

I am saving the files as following:
File.WriteAllBytes(Application.persistentDataPath + "/Main.dat", requestDat.bytes);
File.WriteAllBytes(Application.persistentDataPath + "/Main.xml", requestXml.bytes);

Then attempt to find it using:

DataSet.Exists(Application.persistentDataPath + "/Main", DataSet.StorageType.STORAGE_ABSOLUTE);

but that returns false.
I tried with all three storage types, as I am not sure what kind of storage type I am dealing with.

Thanks in advance

Re: Loading Datasets from external scources

May 8, 2012 - 8:35am #7

I think that you'll need to write the files to the local file system using System.IO .

Here are some examples - http://www.previewlabs.com/file-io-in-unity3d/

Re: Loading Datasets from external scources

May 8, 2012 - 3:13am #6

Yeah, I came across that, but I seem to be missing a link here.

Say, for example, when I download a DataSet on an android phone using a WWW Form in I would have it as a variable, like for example:

private DataSet dataSet;
WWW request = new WWW("http://somewebaddress.com/myfile.dat");
yield return request;
dataSet = request.data;

How would I load that into the application, as dataSet.Load() only accepts a string to a path?

Thanks

Re: Loading Datasets from external scources

May 7, 2012 - 2:15pm #5

There is a DataSet.Load method that takes the storage type as well. Here you can use an absolute path:

dataSet.Load(dataSetPath, DataSet.StorageType.STORAGE_ABSOLUTE)

- Kim

Re: Loading Datasets from external scources

May 7, 2012 - 1:09am #4

I am still having a bit of trouble getting these swappable datasets working. The function DataSet.Load() only accepts a string as a path, so how would I get a file in there that I downloaded through a WWW form from unity?

As far as I know, I can only retrieve files as a variable through that.

Thanks in advance.

Re: Loading Datasets from external scources

May 4, 2012 - 1:00am #3

Awesome, thanks for the quick reply!

Re: Loading Datasets from external scources

May 3, 2012 - 7:09am #2

https://ar.qualcomm.at/qdevnet/sdk , under Getting Started > Mastering Advanced Topics > Swappable Datasets.

You should be able to retrieve the dataset using Unity's WWW class - http://unity3d.com/support/documentation/ScriptReference/WWW.html

Log in or register to post comments