Skip to main content

The Object Scanner Activity

To capture 3D data for objects, initialize the activity with the following:

val session = Dockware.instance.startObjectCaptureActivity(context = context)

The session object this function returns contains a few StateFlow properties, including raw capture data, which can be collected with the following:

lifecycleScope.launch {
session.capturesRaw.collect {
Log.d(TAG, "session raw captures: $it")
}
}

A capturesProcessed StateFlow will be updated with the processed capture data when it become available, which includes image data, identified barcodes, and location:

lifecycleScope.launch {
session.capturesProcessed.collect { captures ->
Log.d(TAG, "session processed captures: $captures")
}
}

dimensions values for processed captures will be null until a review of the point cloud is completed with .review(approve: Boolean), which should be user input approving or denying validity of the point cloud visual. Viewing point clouds can be done following steps on the next page.

Additional properties and events can be configured when starting this activity using DSL syntax as follows:

val session = Dockware.instance.startObjectCaptureActivity(context = context) {
fetchProcessedResults = false,
uploadShipmentId = "ee1d80bb-a656-4c1d-b095-799730019d1c" // An existing shipment ID
showWeightInput = false
onFinish = {}
}
Bonus

You can use the startCaptureActivities() function to capture a document, then immediately capture a 3D object with a single CaptureActivities session that contains both the document and object capture data.