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.
Java
Kotlin
1
ARGConfig config = new ARGConfig(API_URL, API_KEY, SECRET_KEY, AUTH_KEY);
2
3
Set<ARGInferenceConfig.Feature> inferenceConfig
4
= EnumSet.of(ARGInferenceConfig.Feature.FACE_MESH_TRACKING);
5
6
ARGSession argsession = new ARGSession(this, config, inferenceConfig);
Copied!
1
val config = ARGConfig(
2
AppConfig.API_URL,
3
AppConfig.API_KEY,
4
AppConfig.SECRET_KEY,
5
AppConfig.AUTH_KEY
6
)
7
8
val inferenceConfig: Set<Feature> = EnumSet.of(
9
Feature.FACE_MESH_TRACKING
10
)
11
12
argsession = ARGSession(this, config, inferenceConfig)
Copied!
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.
Java
Kotlin
1
ARGSession argsession = new ARGSession(this, config, inferenceConfig);
2
...
3
argsession.resume();
Copied!
1
ARGSession argsession = ARGSession(this, config, inferenceConfig)
2
...
3
argsession.resume()
Copied!

4.3 Pause

To pause the current ARGSession, call pause function inside ARGSession.
Sample code is written below.
Java
Kotlin
1
ARGSession argsession = new ARGSession(this, config, inferenceConfig);
2
...
3
argsession.pause();
Copied!
1
ARGSession argsession = ARGSession(this, config, inferenceConfig)
2
...
3
argsession.pause()
Copied!

4.4 Destroy

To destroy the current ARGSession, use the destroy function.
Sample code is written as follows.
Java
Kotlin
1
ARGSession argsession = new ARGSession(this, config, inferenceConfig);
2
...
3
argsession.destroy();
Copied!
1
ARGSession argsession = ARGSession(this, config, inferenceConfig)
2
...
3
argsession.destroy()
Copied!
Last modified 10mo ago