allprojects { repositories { repositories { flatDir { } } } } android.useAndroidX=true android.enableJetifier=true dependencies.implementation(name: 'UltraleapTrackingServiceBinder', ext: 'aar') import com.ultraleap.tracking.service_binder.ServiceBinder; private static ServiceBinder.Callbacks serviceBinderCallbacks = new ServiceBinder.Callbacks() { public void onBound() { Log.debug("UltraleapTracking OnBound() called"); // onBound } public void onUnbound() { Log.debug("UltraleapTracking OnUnBound() called"); } }; private ServiceBinder serviceBinder; public void AndroidThunkJava_Bind() { if (ServiceBinder.isServiceInstalled(getApplicationContext())) { Log.debug("UltraleapTracking calling bind() on the service binder"); serviceBinder.bind(); } } public void AndroidThunkJava_Unbind() { if (ServiceBinder.isServiceInstalled(getApplicationContext())) { Log.debug("UltraleapTracking calling unbind() on the service binder"); serviceBinder.unbind(); } } // The service binder handles automatically binding to the hand tracking service, it provides a callback interface for checking the bind status. serviceBinder = new ServiceBinder(getApplicationContext(), serviceBinderCallbacks); Log.debug("UltraleapTracking creating the service binder"); if (ServiceBinder.isServiceInstalled(getApplicationContext())) { Log.debug("UltraleapTracking calling bind() on the service binder"); serviceBinder.bind(); } else { } if (!isChangingConfigurations()) { } if (isFinishing()) { Log.debug("UltraleapTracking calling unbind() on the service binder"); serviceBinder.unbind(); }