Last reviewed: 3/23/2024 9:12:53 AM
Java Applications
Develop Java applications that manage movement using your favorite Java development tools. This includes development environments such as Eclipse, IntelliJ, JBuilder, JDeveloper, and NetBeans.
The following sections describe the steps for integrating KinesicsKit with Java applications.
JRE Configuration
KinesicsKit includes Java libraries for JDK 1.8, 11, 17, and 21 to support most application's target runtime environments. If you need a specific target runtime, then contact Chant Product Support.
To access the KinesicsKit Java classes within your application, add the class libraries to your JDK environment:
- copy the JKinesicsKit.DLL file to your Java JDK bin directory;
- copy the applicable 32-bit speech API DLL file(s) to your Java JDK bin directory;
- copy the kinesicskit.jar and chant.shared.jar libraries to your Java JDK lib; and
- append a path reference for your Java JDK lib\kinesicskit.jar and lib\chant.shared.jar paths as a classpath property in your system settings.
- copy the JKinesicsKitX64.DLL file to your Java JDK bin directory;
- copy the applicable 64-bit speech API DLL file(s) to your Java JDK bin directory;
- copy the kinesicskit.jar and chant.shared.jar class libraries to your Java JDK lib; and
- append a path reference for your Java JDK lib\kinesicskit.jar and lib\chant.shared.jar paths as a classpath property in your system settings.
To access the KinesicsKit Java classes within your application, add references to the Chant shared and KinesicsKit class libraries in your code:
import com.kinesicskit.*;
import net.chant.shared.*;
Object Instantiation
Declare a global variable for the KinesicsKit class, instantiate an instance, set the credentials, and set the event handler.
public class Frame1 extends JFrame implements JChantKinesicsKitEvents
{
protected transient JChantKinectSensor _Sensor;
protected JKinesicsKit _KinesicsKit;
private void jInit() throws Exception
{
// Instantiate KinesicsKit object
_KinesicsKit = new JKinesicsKit();
if (_KinesicsKit != null)
{
// Set credentials
_KinesicsKit.setCredentials("Credentials");
// Create KinectSensor
_Sensor = _KinesicsKit.createKinectSensor();
if (_Sensor != null)
{
// Set the callback
_Sensor.setChantKinesicsKitEvents(this);
// Register Callbacks for visual cues.
_Sensor.registerCallback(ChantKinesicsKitCallback.CCKSMultiSourceFrameArrived);
}
}
}
}
KinesicsKit Java applications require the kinesicskit.jar and chant.shared.jar in the target system Java JRE lib directory and/or ensure the classpath includes the path where the kinesicskit.jar and chant.shared.jar libraries are placed on your target system. The KinesicsKit library (JKinesicsKit.dll or JKinesicsKitX64.dll) and the applicable KinesicsKit API library must be in the target system Java JRE bin directory.
Speech API | KinesicsKit Speech API class | KinesicsKit Speech API library |
---|---|---|
Microsoft Kinect 2.0 | JKinectSensor | CKinesicsKit.Kinect.dll or CKinesicsKitX64.Kinect.dll |
Event Callbacks
Event callbacks are the mechanism in which the class object sends information back to the application such as compilation is complete or there was an error.
// Notifies the application when a multi source frame arrives.
public void multiSourceFrameArrived(Object sender, MultiSourceFrameArrivedEventArgs args)
{
MultiSourceFrameReference multiSourceFrameReference = args.getFrameReference();
if (multiSourceFrameReference != null)
{
MultiSourceFrame multiSourceFrame = multiSourceFrameReference.acquireFrame();
if (multiSourceFrame != null)
{
...
multiSourceFrame.dispose();
}
multiSourceFrameReference.dispose();
}
}
Development and Deployment Checklist
When developing and deploying Java applications, ensure you have a valid license, bundle the correct Chant class libraries, and configure your installation properly on the target system. Review the following checklist before developing and deploying your applications:
- Develop and deploy Java applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
- Copy kinesicskit.jar and chant.shared.jar to the target system Java JRE lib directory and/or ensure the classpath includes the path where the kinesicskit.jar and chant.shared.jar libraries are placed on your target system.
- Copy JKinesicsKit.dll to the target system Java JRE bin directory.
- Copy CKinesicsKit.Kinect.dll to the target system.
- Develop and deploy Java applications to any system with a valid license from Chant. See the section License for more information about licensing Chant software.
- Copy kinesicskit.jar and chant.shared.jar to the target system Java JRE lib directory and/or ensure the classpath includes the path where the kinesicskit.jar and chant.shared.jar libraries are placed on your target system.
- Copy JKinesicsKitX64.dll to the target system.
- Copy CKinesicsKitX64.Kinect.dll to the target system.
Sample Projects
Java sample projects are installed at the following location:
- Documents\Chant\KinesicsKit 8\Java.