Topic locked

Modify Database at runtime

May 18, 2021 - 6:35am #1


I'm a new Vuforia user and i'm looking for informations (i'm using Vuforia 9.8.8 with Unity). I want to create an app where an user can take pictures that will be saved in a database (or modify existing targets) and will be used as imageTarget. I know that we can create an imageTarget at runtime and set it with "RuntimeImageSource.SetImage()" but I don't if I can save it to a database (or modify an existing one).

Thanks for your time !


edit: If I wasn't specific enough, I want the user to be able to upload from the app what his camera is currently filming into a Vuforia Database

Modify Database at runtime

June 2, 2021 - 5:11am #5

Hi !

First, I'm trying to get the images from a database. So far, I've created a database where I save my image's path (from my computer) and I use the FileUtil.ReplaceFile function to import the images in Unity as assets. From there, I can create the imageTargets and everything works fine but I doubt it will work on an app after I build it on android for example. Is there a solution where I can use the path of an image (even if the path is from a server) or is the URL the only solution to retrieve an image from a server within an app?


I don't have a lot of knowledge in databases so I'm sorry if that question doesn't make a lot of sense.

I'm using the JSON format as you can see in the attached file


P.S. Well, I realized my question isn't about Vuforia features anymore so, your help should stop here. Thanks for your help !

Image icon json.png24.05 KB

Modify Database at runtime

May 31, 2021 - 7:04am #4

Hello, thank you for your feedback!

Yes , so far I understood your requirements this will be the option I see.

The idea was that your application will connect to a web server where it has permission to read and write (with some interface using rest api e.g. get and post) and will read e.g an json file which contains some kind of app configuration of the used image targets ( the web links). So then later you can create  form there instant targets based on this information.

When your app is in edit mode then you can load some pictures to the web server (post) and also your app  will update the json file accordingly on the web server


Modify Database at runtime

May 31, 2021 - 3:06am #3

Hey, thanks for your complete answer !


I should have described my project earlier but here it is :

I'm working on a pedagogic application where the users will be able to film a statue of an animal and, based on the images on the statue, it will show anatomic informations for example.

My main issue is that I will only work on this project during 3 months and people that will work on this project later on are not from informatic formations so I want to create an interface within the app where they will be able to change some targets, add new ones or modify comportment of existing ones.


Therefore, changes need to be global :

"so one app will take a picture which should be used globally also form apps on others devices"

I made tests with the cloud reco functionality but as far as I know, it can't recognize 2 targets at the same time so we didn't keep that option.

So, a solution would be to save every image on a server and create them all at init time with instant image target ?

Modify Database at runtime

May 25, 2021 - 4:10am #2

Hi, there are some points:

- what is the more value what you want to have here? e.g. Why you do not want to use the simplest possible way ? - the instant image target creation as described in the article "How to create and load Targets in Unity" were we can create an image Target from local file or from file on web server -described in the sections: "How to create Instant Image Targets at Runtime from a file or Texture2D Objects" and "Loading a database created with the Vuforia Target Manager at runtime" in the mentioned above link.

-the second point is that so far I know , currently the supported way  to create and download   a device database is only manually. So one time create the database could be Loaded and change in the application on runtime as described in "Loading a database created with the Vuforia Target Manager at runtime" and "How to size an Image Target at Runtime"

Regarding to the point that you want e.g. take a picture and then make it available :

- if only local reuse is required - I think the instant image target creation will be a good solution - / or please provide some arguments why this will not work in your case

- if a global usage is required - so one app will take a picture which should be used globally also form apps on others devices - then you can try to save the picture to web server location and let say at init time on your app you can create in your app all the instant targets from the available images of specific web server location. Another option could be to use the  cloud reco functionality  . Targets in Cloud Databases can be managed using either the Target Manager or the Vuforia Web Services API. The VWS Samples in Java and PHP demonstrate recommended practices for executing calls to Vuforia Web Services


Vuforia Engine Support

Topic locked