Skip to main content

Android Framework API References

Initialization Method

GlamAr.init(
context: Context,
accessKey: String,
overrides: GlamAROverrides? = null,
webView: WebView? = null,
debug: Boolean = false
)

Parameter Descriptions

ParameterTypeRequiredDescription
contextContextYesThe Android context, typically passed from an Activity or Fragment. Used for WebView creation and permission handling.
accessKeyStringYesYour unique Access key to authenticate the SDK usage.
overridesGlamAROverrides?NoConfiguration object to control AR behavior, UI, and metadata. See GlamAROverrides for details.
webViewWebView?NoIf provided, the SDK will use this WebView instance instead of creating a new one. Allows full control over rendering. Defaults to null.
debugBooleanNoEnables 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

ParametersDescriptionTypeOptions
optionsPass start (Required)stringstart

addEventListener

GlamAr.addEventListener(eventName, handlerFunction);

Adds the listener to the given event name.
Return Value: None

ParametersTypeDescription
eventNamestring

A Name of specific event or "*" To listen to the all the events.

handlerFunctionfunction Your handler function that will listen to callback.

removeEventListener

GlamAr.removeEventListener(eventName, handlerFunction);

Removes the given listener for the event name.
Return Value: None

ParametersTypeDescription
eventNamestring

A Name of specific event or "*" To remove all the events.

handlerFunctionfunction Your handler function that will listen to callback.

isLoaded

GlamAr.isLoaded();

Returns the status of module loading.
Return Value: true if loaded, otherwise false

ParametersDescription

None

No parameters required.

reset

GlamAr.reset();

Removes all the current effects from the canvas.
Return Value: None

ParametersDescription

None

No parameters required.

close

GlamAr.close();

Closes canvas and returns to the main widget page.
Return Value: None

ParametersDescription

None

No parameters required.

snapshot

GlamAr.snapshot();

After a successfully scan, client can be get a PDF of his scan from share event
Return Value: none

ParametersDescription

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.