Topic has a solution and is locked
Topic locked

How do I get call back when the image target was detected

Android Studio
August 4, 2022 - 6:14am #1
Topic solved

I was doing the project using vuforia native on android studio where the native api was called by JNI-C++ and then called by java-android, I want to get notification on android layer when the vuforia detects/loses the image target. 

I found out that on Unity API, we get the event of "OnTargetStatusUpdated" under "ObserverBehaviour" class which we can subscribe our own function to thus we can get the status when the observer status changed.

The problem for me is that I want to know where to bind the function which can be called when the observer changed in the native API just like in Unity API

Platform: 

How do I get call back when the image target was detected

September 6, 2022 - 9:24am #2

Hey there,

 

The problem here is that our native APIs are very low-level compared to their Unity counterpart. It doesn't have a dedicated "notification mechanism" as the Unity SDK. 

I did however asked around internally and this is some feedback provided: "In the native API you need to get this information through the Vuforia State update mechanism. The Vuforia State represents a “snapshot” of what is known at a particular point in time. The user could then build similar logic on top of this, e.g. by keeping track of the status of observations from a particular observer across State updates to detect changes in tracking status and then trigger his/her own notification mechanism."

You can find information about the Vuforia State here: https://library.vuforia.com/sites/default/files/references/native/group__EngineStateUpdateGroup.html

Let me know if you have any other questions and if that satisfies your initial question.

 

Kind regards,

Patrick Scheper

Vuforia Engine Product Manager

Topic locked