Android Framework API References
Initialization Method
GlamAr.init(
context: Context,
accessKey: String,
overrides: GlamAROverrides? = null,
webView: WebView? = null,
debug: Boolean = false
)
Parameter Descriptions
| Parameter | Type | Required | Description |
|---|---|---|---|
| context | Context | Yes | The Android context, typically passed from an Activity or Fragment. Used for WebView creation and permission handling. |
| accessKey | String | Yes | Your unique Access key to authenticate the SDK usage. |
| overrides | GlamAROverrides? | No | Configuration object to control AR behavior, UI, and metadata. See GlamAROverrides for details. |
| webView | WebView? | No | If provided, the SDK will use this WebView instance instead of creating a new one. Allows full control over rendering. Defaults to null. |
| debug | Boolean | No | Enables detailed logging from the SDK. Useful for development/debugging. Defaults to false. |
GlamAROverrides allows developers to customize the behavior, appearance, and initialization of the GlamAR SDK when integrating it into an Android app.
You can pass this configuration object directly into the SDK initialization:
GlamAr.initialize(
context = this,
accessKey = "your-access-key",
overrides = GlamAROverrides(...) // ← Custom behavior here
)
GlamAROverrides Structure
category: String?
Category has to be sent as skinanalysis. (Required)
Full Example
val overrides = GlamAROverrides(
category = "skinanalysis",
)
configuration: Configuration?
Contains the Skin analysis configuration
val overrides = GlamAROverrides(
configuration = Configuration(
skinAnalysis = SkinAnalysisConfig(
appId = "your_skin-app-id"
)
)
)
Post-Initialization Methods
open
GlamAr.skinAnalysis(options);
Opens the Skin Analysis flow.
Return Value: None
| Parameters | Description | Type | Options |
|---|---|---|---|
| options | Pass start (Required) | string | start |
addEventListener
GlamAr.addEventListener(eventName, handlerFunction);
Adds the listener to the given event name.
Return Value: None
| Parameters | Type | Description |
|---|---|---|
| eventName | string | A Name of specific event or "*" To listen to the all the events. |
| handlerFunction | function | Your handler function that will listen to callback. |
removeEventListener
GlamAr.removeEventListener(eventName, handlerFunction);
Removes the given listener for the event name.
Return Value: None
| Parameters | Type | Description |
|---|---|---|
| eventName | string | A Name of specific event or "*" To remove all the events. |
| handlerFunction | function | Your handler function that will listen to callback. |
isLoaded
GlamAr.isLoaded();
Returns the status of module loading.
Return Value:trueif loaded, otherwisefalse
| Parameters | Description |
|---|---|
None | No parameters required. |
reset
GlamAr.reset();
Removes all the current effects from the canvas.
Return Value: None
| Parameters | Description |
|---|---|
None | No parameters required. |
close
GlamAr.close();
Closes canvas and returns to the main widget page.
Return Value: None
| Parameters | Description |
|---|---|
None | No parameters required. |
snapshot
GlamAr.snapshot();
After a successfully scan, client can be get a PDF of his scan from
shareevent
Return Value: none
| Parameters | Description |
|---|---|
None | No parameters required. |
Events
The GlamAR SDK emits various events throughout its lifecycle to help you monitor state, respond to user actions, and handle success or failure cases.
You can register for these events using the SDK's event listener system:
glamArView.addEventListener("loaded") {
// SDK has fully loaded
}
glamArView.addEventListener("skin-analysis") { data ->
// Handle skin analysis data
}
Each event is triggered from within the GlamAR SDK and may optionally include a payload, check Events Page for event details.