Log in or register to post comments

Updating dat and xml files

May 7, 2014 - 12:51am #1


I use Image Target samples to recognize images that i stored in device database and i have dat and xml files in android asset folder

My question is, how may i update these dat and xml files when i update device database (add/remove target) by not updating the application? I have JSON service that will keep urls for xml and dat files.




Updating dat and xml files

November 25, 2016 - 1:30am #6


Updating dat and xml files

May 12, 2014 - 4:16am #5

Hey  Alessandro,

I followed your answer and this answer but i get this " StorageType cannot be resolved or is not a field " and " myDataSet cannot be resolved ". I use core Java and don't have C++ and unity3d codes. 

Simply my .dat and .xml files' path is defined like this ;

File root = android.os.Environment.getExternalStorageDirectory();

root.getAbsolutePath() + "/AveaEtiket/"+"/Etiket.xml"

root.getAbsolutePath() + "/AveaEtiket/"+"/Etiket.dat"

Can you share some code to call them as new datasets? I am really stuck about that.




PS:I add ImageTarget.java 

Package icon ImageTargets.zip7.03 KB

Updating dat and xml files

May 9, 2014 - 6:49am #4

 how to call new .dat file that a .dat file already exists in asset folder?

You should probably create your Datasets each time with a new name, for example taking the date of creation into account; for example, "MyDataset_2014-05-09", or by appending some version number, e.g. "MyDataset-002" or the like, but this is a bit up to you and to how you want to manage your datasets on the server.

So, when you save the Dataset on your device, it should be saved using the same name of the file downloaded from the Server (i.e. each time using a different name as above).

Then, on the mobile App, you will need to call myDataSet.Load( ... ) passing the name of the latest Dataset you want to use.



Updating dat and xml files

May 9, 2014 - 6:27am #3


Thanks for detailed reply. I managed to make a json web service and to get .dat and .xml files from it to device internal storage. My question is about how to call new .dat file that a .dat file already exists in asset folder? I guess mCurrentDataSet holds .dat information, but i dont know how to change it with new .dat file.

Updating dat and xml files

May 9, 2014 - 1:05am #2

One option could be to host your Dataset files on a Server, and have your App connect to the server via a URL and download the new Datasets, if some new files are available.

You could then store the downloaded datasets into the Device external storage (e.g. the SD card on Android devices, for example), and then load the Dataset from that location, using the DataSet.load() method with STORAGE_TYPE enum set to = STORAGE_ABSOLUTE



However, how you implement such a server and download service is not in the scope of Vuforia.


Another option (recommended) would be to use the Cloud Recognition service (i.e. hosting your targets on a Cloud Database).





Log in or register to post comments