Log in or register to post comments

Is there way to identify which target i am scanning in unity genarated android code

July 16, 2017 - 11:16pm #1

I am developing augmented reality app using unity with vuforia library. And I have exported the unity project to Android project. it's given only UnityPlayerActivity just opening that activity AR is working fine. Now I want to know which target is currently I am seeing. Is there any callback to get that information.

Is there way to identify which target i am scanning in unity genarated android code

July 19, 2017 - 9:54pm #7

Yes, Already I worked with vuforia native SDK. But I Have more 3D object rendering, textures, rigg character, textures with animation etc... So I have chosen unity to achieve that. In vuforia native SDK those are difficult to achieve.

Is there way to identify which target i am scanning in unity genarated android code

July 19, 2017 - 9:30am #6

Have you looked into using the native Android SDK? This provides the Vuforia API in native Android without having to use Unity.

You can download it here: https://developer.vuforia.com/downloads/sdk and here is a link for getting started with the native API in Android Studio https://library.vuforia.com/articles/Solution/Getting-Started-with-Vuforia-for-Android-Development

If you've already looked into this and decided against it, could you let me know what led to that decision?

Thanks,

-Vuforia Support

Is there way to identify which target i am scanning in unity genarated android code

July 19, 2017 - 12:22am #5

Hi,

 

These are the reasons I am exporting unity to Android project,

* I am not developing an entire app in unity. Only for AR, I am using Unity.

* Apart from  AR I am developing my app in native Android itself. In that, some business logic needs the currently detected target information.

* So please guide me where can I get a callback from Exported unity code in native or Please guide if any other possibilities to achieve my above requirement.

Is there way to identify which target i am scanning in unity genarated android code

July 18, 2017 - 4:54pm #4

The workflow you are describing isn't a recommended Vuforia workflow. Vuforia was designed for authoring apps in the development tool for which they were created. The APIs in both native and Unity have access to the information you need.

Could you provide more details as to why you're exporting the project from Unity into an Android native project and what benefits that is providing you?

Thanks,

-Vuforia Support

Is there way to identify which target i am scanning in unity genarated android code

July 18, 2017 - 12:07am #3

Hi,

After exporting the unity project to android it's giving only one Activity there no callback to find whether image target detected or not. Where can I access Trackable class? After export, there is no control to access Trackable data. Please explain how to get.

Is there way to identify which target i am scanning in unity genarated android code

July 17, 2017 - 10:40am #2

Hello ssuresh1295,

It is possible to get the name of the target currently detected in both Unity and native Android.

https://library.vuforia.com/reference/api/unity/classVuforia_1_1TrackableBehaviour.html#ae1454d82fe3ec6cd8a3ac554ef74559d

This class contains a field called "TrackableName" which is the name of the currently detected target.

https://library.vuforia.com/reference/api/java/classcom_1_1vuforia_1_1Trackable.html

This class contains a function called "getName()" that returns the name of the currently detected target.

For examples on how to get and use these in an application, please refer to our sample projects:

https://developer.vuforia.com/downloads/samples

Thanks,

-Vuforia Support


Log in or register to post comments