Log in or register to post comments

CloudReco Access and Secret Key in runtime

March 26, 2013 - 11:57pm #1

Hello,

Is it possible to change the CloudReco database by changing the Access and Secret Key in runtime?

Please advise.

CloudReco Access and Secret Key in runtime

March 7, 2014 - 4:25am #33

Hi abhishekkeshri1111

we don't support Vuforia 2.0 anymore. However, in that version, you simply need to change the secretKey and accessKey variables in CloudReco.cpp and then run ndk-build from a command line, and then refresh Eclipse project.

Note that the dev guide still explains how to build the native samples using NDK:

https://developer.vuforia.com/resources/dev-guide/step-3-compiling-running-vuforia-sample-app

CloudReco Access and Secret Key in runtime

March 6, 2014 - 1:54pm #32

Dear  AllasendroB,

 

I am using vuforia 2-0-6 Sdk . I want to change my Access key and Secret key. Will i have to recompile with Ndk-build to get libcloudreco.so file.

from where we can get the old documentation where ndk-build was define clearly.

CloudReco Access and Secret Key in runtime

March 5, 2014 - 3:44am #31

You need to be able to debug simple syntax errors like this which have nothing to do with Vuforia.

Search the sample code for how to use e.g. the Cloud Reco sample:

        CloudRecoBehaviour cloudRecoBehaviour = GameObject.FindObjectOfType(typeof(CloudRecoBehaviour)) as CloudRecoBehaviour;

 

N

CloudReco Access and Secret Key in runtime

March 5, 2014 - 12:22am #30
CloudRecoBehaviour crb = FindObjectOfType<CloudRecoBehaviour>();

above code gives error in unity3d, "error CS1501: No overload for method `FindObjectOfType' takes `0' arguments". i'm using sdk 2.8.7

CloudReco Access and Secret Key in runtime

March 3, 2014 - 7:46am #29

Is it possible to connect more than one Device Databases in my mobile application?

Yes

CloudReco Access and Secret Key in runtime

March 3, 2014 - 7:39am #28

Ok. I will use only one Cloud Database!

Is it possible to connect more than one Device Databases in my mobile application?

CloudReco Access and Secret Key in runtime

March 3, 2014 - 5:46am #27

Can I use more than one Cloud Databases in app?

No, it is designed to use just one DB which is the whole point of Cloud Reco - to handle large datasets.

 

Why do you need multiple databases?

 

N

 

 

CloudReco Access and Secret Key in runtime

March 2, 2014 - 9:46pm #26

I want to create many databases, which easy to manage by different users of my service by VWS API. Users can upload images and some different content on my serverside and than other users may recognize all of the images via different datasets on their mobile app. But I'm in trouble with setting up client secret and client access keys for recognize all of the existed DBs at one time. Can I use more than one Cloud Databases in app? What can you advice in my case?

CloudReco Access and Secret Key in runtime

January 18, 2014 - 4:24am #25

You don't have to build the samples with NDK; as I said previously, the new samples are built in Java, using the new Java API of Vuforia 2.8.

So, you don't need to run ndk-build (unless you have added some custom C++ code and you want to build that).

 

CloudReco Access and Secret Key in runtime

January 17, 2014 - 12:07pm #24

When i complie new sample from NDK  cygwin then it shows the error

"Version 9 in ./AndroidManifest.xml

Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ./jni/Android.mk  
/cygdrive/c/Development/Android/android-ndk-r8d/build/core/add-application.mk:165: *** Android NDK: Aborting...    .  Stop."  
 
 
What is the reason for this Error
 
Thanks in Advance

CloudReco Access and Secret Key in runtime

January 14, 2014 - 1:11pm #23

Dear AlessandroB I worked on that,but i could not success to get Unique ID in in java file. Can u plese write down that line of Code I have to use in java file, Its very Urgent..

 

and for the New sdk when I run from cygwin then it says Error

Abhishek@Abhishek-PC /cygdrive/c/development/android/android-ndk-r8d/samples/vuforiasamples-2-8-8

$ ndk-build
/cygdrive/c/Development/Android/android-ndk-r8d/build/core/add-application.mk:128: Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 9 in ./AndroidManifest.xml
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: ./jni/Android.mk  
/cygdrive/c/Development/Android/android-ndk-r8d/build/core/add-application.mk:165: *** Android NDK: Aborting...    .  Stop.
 
What can be solution??? Plese
 
Thanks in advnce
 

CloudReco Access and Secret Key in runtime

January 14, 2014 - 12:39am #22

So Can you plese tell me the code that i will have to use in cloudreco.java file, I have posted >pp file code in my prevoious comment.

I already replied to your question: you need to understand how to pass parameters from C++ and Java using JNI (see also the JNI link I have posted in previous message); for the rest, the sample code already contains everything you need, you just need to adapt it to your specific application needs.

and one more question that For the New Sdk I will will also have to rebuild with NDk?? and Can i do all the thing that i was doing in the previous Sdk.

If you use the new SDK, you can still use the C++ API (which is still available); if you do that, you will still need to recompile the C++ code with ndk-build;

on the other hand, the new SDK (2.8) also offers a full Java API, which allows you to write your entire app in Java, without having to go to C++ and without having to use the NDK.

 

CloudReco Access and Secret Key in runtime

January 13, 2014 - 9:18pm #21

So Can you plese tell me the code that i will have to use in cloudreco.java file, I have posted >pp file code in my prevoious comment.

and one more question that For the New Sdk I will will also have to rebuild with NDk?? and Can i do all the thing that i was doing in the previous Sdk.

CloudReco Access and Secret Key in runtime

January 13, 2014 - 9:56am #20

Yes, you always need to rebuild with ndk-build (in cygwin or from a windows cmd console) whenever you make changes to the C++ native code.

 

CloudReco Access and Secret Key in runtime

January 13, 2014 - 8:44am #19

Thanks a lot for Quick Reply,

I am less away from my Peak  Please help me,

Will i have to again create *.so file.

This is the code in CloudReco.Cpp file, But I am not able to get in cloudreco.java file

Will i have to again compile it from Cygwin??

 

class CloudReco_UpdateCallback : public QCAR::UpdateCallback
{
String uniqueID;
    virtual void QCAR_onUpdate(QCAR::State& state)
    {
        // Get the tracker manager:
        QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();
 
        // Get the image tracker:
        QCAR::ImageTracker* imageTracker = static_cast<QCAR::ImageTracker*>(
                trackerManager.getTracker(QCAR::Tracker::IMAGE_TRACKER));
 
        // Get the target finder:
        QCAR::TargetFinder* finder = imageTracker->getTargetFinder();
 
        // Check if there are new results available:
        const int statusCode = finder->updateSearchResults();
 
        // Show a message if we encountered an error:
        if (statusCode < 0)
        {
            showErrorMessage(statusCode, state.getFrame().getTimeStamp());
        }
        else if (statusCode == QCAR::TargetFinder::UPDATE_RESULTS_AVAILABLE)
        {
            // Process new search results
            if (finder->getResultCount() > 0)
            {
                const QCAR::TargetSearchResult* result = finder->getResult(0);
 
                // Check if this target is suitable for tracking:
                if (result->getTrackingRating() > 0)
                {
                    // Create a new Trackable from the result:
                    QCAR::Trackable* newTrackable = finder->enableTracking(*result);
                    if (newTrackable != 0)
                    {
                        LOG("Successfully created new trackable '%s' with rating '%d'.",
                                newTrackable->getName(), result->getTrackingRating());
                                                
                        // Checks if the targets has changed
                        LOG( "Comparing Strings. currentTargetId: %s  lastTargetId: %s",
                                result->getUniqueTargetId(), lastTargetId);
                        uniqueID = result->getUniqueTargetId();
                        System.out.println("id is "+uniqueID);
                        printf("comphiiiii %d",uniqueID);
);
 
                       // System.out.println("valueeee"+result->getUniqueTargetId());
 
                        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);
 
                        }
                        else
                            renderState = RS_NORMAL;
 
                        // Initialize the frames to skip variable, used for waiting
                        // a few frames for getting the chance to tracking before
                        // starting the transition to 2D when there is no target
                        pthread_mutex_lock(&framesToSkipMutex);
                        framesToSkipBeforeRenderingTransition = 10;
                        pthread_mutex_unlock(&framesToSkipMutex);
 
                        // Initialize state variables
                        showAnimation3Dto2D = true;
                        trackingStarted = false;
 
                        // Updates the value of the current Target Id with the new target found
                        pthread_mutex_lock(&lastTargetIdMutex);
                        strcpy(lastTargetId, result->getUniqueTargetId());
                        pthread_mutex_unlock(&lastTargetIdMutex);
 
                        enterContentMode();
                    }
                    else
                        LOG("Failed to create new trackable.");
                }
            }
        }
    }
};
 

CloudReco Access and Secret Key in runtime

January 13, 2014 - 8:35am #18

You can get the unique target ID in Java, by passing that information from C++ to Java using JNI (Java Native Interface);

for more information about JNI C++/Java communication, see here:

https://developer.vuforia.com/resources/dev-guide/java-native-interface

 

CloudReco Access and Secret Key in runtime

January 13, 2014 - 8:26am #17

that mean From vuforia 2.0.30 ,we can not get unique targetid in my cloud reco.java file, while i am getting that id  in Cloudreco.cpp file.  

So is there any way to use  that Id in cloudreco.ava. Plese provide me some solution to get in Cloudreco.java fiile.

CloudReco Access and Secret Key in runtime

January 13, 2014 - 4:23am #16

Vuforia 2.0.30 does not have a Java API (C++ only); the only Java code is the one that you use to setup the main Activity and the Renderer, and to glue that with the C++ code via JNI.

if you want to use the Java API, you need to upgrade to the latest 2.8.7. 

 

CloudReco Access and Secret Key in runtime

January 13, 2014 - 3:12am #15

I am working on old vuforia , Can i PM u my cloud Reco.java file??

That is vuforia 2_0_30 version.
I have to get unique id in that code . I am working on my previous project.

CloudReco Access and Secret Key in runtime

January 13, 2014 - 1:02am #14

If you are using the latest Vuforia SDK (2.8.7), have a look at the CloudReco.java code in the VuforiaSamples-2-8-7 project; 

this contains the code that you need to use; in particular, the relevant code is in the onQCARUpdate() method.

CloudReco Access and Secret Key in runtime

January 12, 2014 - 5:20am #13

Sorry for stupid Question,

 

I have got that code from cloudreco.cpp but I am not able to get that Code in Cloudreco.java file,  So i just want to get that Unique Id in my cloud reco.java file.

I Just want to get that value in cloudreco.java file. Please tell me in detail  to get that value in My java File.

When i am using String uniqueid=TargetSearchResult.getUniqueId(); It is showing Error.  I  My code there is no any TargetSearchResult Class.  

Please provide me solution

 

Thanks in Advance.

CloudReco Access and Secret Key in runtime

January 12, 2014 - 1:02am #12

You can use the getUniqueTargetId() method of the QCAR::TargetSearchResult class. Please, consult the API reference and developer guide for questions that are already answered there:

https://developer.vuforia.com/resources/api/classcom_1_1qualcomm_1_1vuforia_1_1_target_search_result

 

CloudReco Access and Secret Key in runtime

January 10, 2014 - 11:11pm #11

Hii, AllessendroB

 

 Can you pllese tell me that how can i get Unique Traget iD  In vuforia cloud recognition service through our code.

CloudReco Access and Secret Key in runtime

January 5, 2014 - 9:11am #10

The QCAR::TargetFinder can only be initialized with one pair of secret/access keys; this means that you can only interact with one cloud database at a time;

to use more DBs in the same app, you could stop the TargetFinder and reinitialize it with the keys of another database; that would allow your app to connect and use more than one DB, i.e. to switch from one to the other at runtime; however, you cannot use them at the same time (as you only have one TargetFinder instance).

 

 

CloudReco Access and Secret Key in runtime

January 5, 2014 - 3:55am #9

Hi I think I couldnt explain what I would like, let me try again.

I already changed with my access and secret keys, but it is just for one database.

If I want to use the same application to recognize other database, which will have different keys, is possible to add more than one cloud dabatase access and secret keys to the same app ? Or is just one cloud database per application.

What would be the way to implement this ? Im using iOS

CloudReco Access and Secret Key in runtime

January 4, 2014 - 12:05pm #8

In Vuforia SDK 2.8.7, in the VuforiaSamples-2-8-x project,  you need to change the strings called kAccessKey and kSecretKey in the CloudRecoViewController.mm source file, located under the folder "vuforia-sdk-ios-2-8-7\samples\VuforiaSamples-2-8-9\VuforiaSamples\Classes\apps\CloudReco"

 

 

CloudReco Access and Secret Key in runtime

January 4, 2014 - 11:10am #7

Hi there i would like to change the access key and private key at runtime too but on iOS.

How it will be in iOS ?

 

Thanks

Cheers!

CloudReco Access and Secret Key in runtime

March 27, 2013 - 3:52am #6

you're welcome.

CloudReco Access and Secret Key in runtime

March 27, 2013 - 2:03am #5

Thank you AlessandroB :)

CloudReco Access and Secret Key in runtime

March 27, 2013 - 1:43am #4

Ok, so you should be able to do that by placing some code like this in one of your scripts:

disable cloud reco:

CloudRecoBehaviour crb = FindObjectOfType<CloudRecoBehaviour>();
crb.enabled = false; //disable cloud reco
		

enable cloud reco with the new keys:

 

CloudRecoBehaviour crb = FindObjectOfType<CloudRecoBehaviour>();
crb.AccessKey = "new key xxxxx";
crb.SecretKey = "new key yyyyy";
crb.enabled = true;

CloudReco Access and Secret Key in runtime

March 27, 2013 - 12:57am #3

I am using Unity :)

CloudReco Access and Secret Key in runtime

March 27, 2013 - 12:12am #2

Yes, this is possible; are you using Unity or Android or iOS native ?

 

Log in or register to post comments