GraffityARCloudListener
Public callback interface in tech.graffity.android.arcloud.publicapi. Assign sdk.listener before hosting. The SDK stores a weak reference, so your owner must retain the listener.
All callbacks run on the main dispatcher. Every method has a default empty implementation except onRequestOpenUrl, which defaults to false.
Callback signatures
The following interface declaration is provided by the SDK. Implement the callbacks you need on your own listener.
import android.net.Uri
import tech.graffity.android.arcloud.publicapi.*
interface GraffityARCloudListener {
fun onStateChanged(sdk: GraffityARCloudSDK, state: GraffityARState) {}
fun onContentTapped(sdk: GraffityARCloudSDK, contentId: String) {}
fun onContentCollected(
sdk: GraffityARCloudSDK,
contentId: String,
activity: GraffityARActivity
) {}
fun onLocalized(sdk: GraffityARCloudSDK, sectionId: String) {}
fun onActiveLocGuidanceUpdated(
sdk: GraffityARCloudSDK,
targetWorldPose: FloatArray?,
progress: Double
) {}
fun onActiveLocInliers(sdk: GraffityARCloudSDK, inliers: Int, iteration: Int) {}
fun onNavigationStarted(sdk: GraffityARCloudSDK, destination: GraffityARDestination) {}
fun onNavigationArrived(sdk: GraffityARCloudSDK, destination: GraffityARDestination) {}
fun onNavigationStopped(sdk: GraffityARCloudSDK) {}
fun onError(sdk: GraffityARCloudSDK, error: GraffityARCloudError) {}
fun onRequestOpenUrl(
sdk: GraffityARCloudSDK,
url: Uri,
source: GraffityAROpenUrlSource
): Boolean = false
}| Event | Meaning |
|---|---|
onStateChanged | Public state changed. |
onContentTapped | A content database ID was tapped. |
onContentCollected | Collection recorded; inspect the returned activity. |
onLocalized | Initial localization or localization into a different section. |
onActiveLocGuidanceUpdated | Optional nullable 16-float target pose and hold progress in 0–1. |
onActiveLocInliers | Optional server PnP inlier count and iteration. |
onNavigationStarted | Navigation started toward a destination. |
onNavigationArrived | Final destination reached. |
onNavigationStopped | Navigation stopped. |
onError | SDK operation/session error. |
onRequestOpenUrl | Synchronous link interception; true means handled by your app, false uses the default Custom Tab. |
Flow observation can run alongside callbacks. Content, URL, guidance, and discrete navigation events are not all represented in state. See taps, collection, and observation.