4. ARGSession

ARGSession maintains the status of your application and manages the life cycle of your application according to the status.

4.1 Init & Create

When creating ARGSession, you can pass ARGConfig and ARGInferenceConfig.Feature parameters. ARGConfig contains API URL, API key, secret key, and auth key and it must be sent to ARGSession.

You must pass ARGInferenceConfig.Feature parameter to ARGSession and the selected feature will be obtained. The configured feature information can be obtained from ARGFrame. (For related information, please refer to 12.1 ARGSession and 12.3 ARGFrame.)

Below is sample code to create ARGSession.

ARGConfig config  = new ARGConfig(API_URL, API_KEY, SECRET_KEY, AUTH_KEY);

Set<ARGInferenceConfig.Feature> inferenceConfig
        = EnumSet.of(ARGInferenceConfig.Feature.FACE_MESH_TRACKING);

ARGSession argsession = new ARGSession(this, config, inferenceConfig);

Unless properly setting ARGConfig during ARGSession creation, ARGear SDK will not be initiated. Therefore, you must create an account in https://argear.io,set the created API Key information in ARGConfig, and create ARGSession with the ARGConfig to use ARGear SDK.

4.2 Resume

To start or resume the currently used ARGSession, simply call the “resume” function inside.

Sample code is written below.

ARGSession argsession = new ARGSession(this, config, inferenceConfig);
  ...
argsession.resume();

4.3 Pause

To pause the current ARGSession, call pause function inside ARGSession.

Sample code is written below.

ARGSession argsession = new ARGSession(this, config, inferenceConfig);
  ...
argsession.pause();

4.4 Destroy

To destroy the current ARGSession, use the destroy function.

Sample code is written as follows.

ARGSession argsession = new ARGSession(this, config, inferenceConfig);
  ...
argsession.destroy();

Last updated