ARGSession

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

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. On the other hand, you can selectively pass ARGInferenceConfig. Feature parameter and you can check the set featured information from ARGFrame later. (For the related information, please refer to 12.1 ARGSession and 12.3 ARGFrame.)

Below is the 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_TRACKING,
ARGInferenceConfig.Feature.FACE_LANDMARK_2D);
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.

Resume

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

A sample code is written below.

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

Pause

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

A sample code is written below.

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

Destroy

To destroy the current ARGSession, destroy function in ARGSession will do for you.

A sample code is written as follows.

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