Hi,
first, I am happy to hear that you were able to make cloud reco work with your own images;
so, if I understand correctly, you managed to successfully retrieve and to display the Book data in the CloudReco sample using your own image from your Cloud DB.
Now, concerning your second question ("...to get our own information from the database..."), this is more application-specific; in practice, the CloudReco sample obtains the metadata associated with the recognized target (for instance, in your case, it retrieves the string "samplebook1.json" when your target "image1" is recognized) and then it uses that metadata to query another Database from which it can retrieve the Book data (which are represented by a JSON object with several attributes such as the title of the book, the author, the price, the rating, etc.).
The relevant code where the metadata are obtained from the recognized target is located in the class called CloudReco_UpdateCallback (in CloudReco.cpp), and the relevant code snippet in the sample is the following:
if (strcmp(result->getUniqueTargetId(), lastTargetId) != 0)
{
// If the target has changed then regenerate the texture
// Cleaning this value indicates that the product Texture needs to be generated
// again in Java with the new Book data for the new target
deleteCurrentProductTexture = true;
// Starts the loading state for the product
renderState = RS_LOADING;
// Copies the new target Metadata
snprintf(targetMetadata, CONTENT_MAX, "%s", result->getMetaData());
// Calls the Java method with the current product texture
createProductTexture(targetMetadata);
}
The relevant code which instead creates the so-called "product texture", i.e. the texture representing the Book data, is again in CloudReco.cpp:
void
createProductTexture(const char* targetMetadata)
{
// Check that the JNI handles are setup correctly:
JNIEnv* env = 0;
if (javaVM != 0 && createProductTextureID != 0 && activityObj != 0
&& javaVM->GetEnv((void**)&env, JNI_VERSION_1_4) == JNI_OK)
{
env->CallVoidMethod(activityObj, createProductTextureID, env->NewStringUTF(targetMetadata));
}
}
finally, the method called "createProductTextureID" is defined in Java, in the file CloudReco.java:
public void createProductTexture(String bookJSONUrl)
{
// gets book url from parameters
mBookJSONUrl = bookJSONUrl.trim();
// Cleans old texture reference if necessary
if (mBookDataTexture != null)
{
mBookDataTexture = null;
System.gc();
}
// Searches for the book data in an AsyncTask
mGetBookDataTask = new GetBookDataTask();
mGetBookDataTask.execute();
}
The GetBookDataTask class represents a task which can connect to a Database and retrieve the Book data, based on the input metadata, by connecting to a server which is located at this URL (see code in GetBookDataTask.java):
private static final String mServerURL = "https://ar.qualcomm.at/samples/cloudreco/json/";
However, it is important to understand that this is just the sample implementation; the database containing the Book data is just used to demonstrate an example of what can be done by using metadata;
however, this is not a core feature of CloudReco (i.e. the Book database and server has nothing to do with CloudReco itself, it's just there for that specific usage of the example);
so, that is to say that if you want to exploit your metadata, you can do it in the way you like, there is no feature in Vuforia that supports something like the Book database out-of-the-box;
so, this part really depends on your specific application requriements.
How do I load only website instead of books of information.
Please update view.