This article provides an example of how to integrate a custom Android plugin (implemented natively in Java) into a Vuforia Unity project.
We’ll consider a simple Unity-based Vuforia Engine application that:
- can detect and track an Image Target, from a Device Database
- displays a popup message on the screen for a few seconds when a target is detected; the message will contain some basic information about the detected target (e.g. target name and size)
The skeleton of the App will be developed in Unity, using the Vuforia Unity Extension, while the specific function that displays the popup message will be implemented natively in Java, using the Android SDK.
The native Android/Java code will be packaged in a plugin library (a JAR) that will be added to the Unity project assets, so that the Unity application code will be able to access the plugin functions.