About Shoot Builder

Shoot builder is an object where all the configuration settings are set up for Spyne Android SDK. Shoot builder expects basic parameters and allows you to use advanced functionalities as well.

Create a shoot builder function

Shoot builder function expects 4 values,

  1. context is the current activity context
  2. userId is a string value and unique userId at your end
  3. skuListener is the callback interface which you have to implement in your activity/fragment and over-ride the given methods,
    • onSkuCreated: This callback is returned on project creation & returns SpyneSKUId. SpyneSKUId will be useful on fetching processed images using our Public API.
    • onShootCompleted: This callback is returned on project completion. Please note, in case of reshoot, this callback is returned will extra parameter isReshoot. This parameter will be true in cases where reshoot has taken place.
  4. Angle is the integer value and denotes the count of exterior angles to be shot by the user.
skuListener methods
fun onSkuCreated (skuId: String)
fun onShootCompleted(skuId: String, isReshoot: Boolean)

Shoot Builder Object
var builder = Spyne.ShootBuilder(
context: this,
userId: "myUniqueUserId"
skuListener: this,
angle: 8
)

Add ShootID configuration to Shoot Builder

ShootID expects a string value and is a mandatory key which will be mapped to the unique Spyne SKU Id.
Do note, ShootID does not allow blank values and special characters.

builder.uniqueShootId(uniqueShootId: "myUniqueShootId")

Specifying Shoot type

Spyne SDK allows user to Shoot through guided flow as well as Upload images. Before initiating the SDK shoot, shoot type expects a specific value.

Options for Shoot type:

  1. Shoot [default] will initiate the Spyne guided Shoot flow
  2. Upload will initiate the Upload flow
  3. Both will initiate both the flows and give user the option to choose
builder.ShootType(ShootType.UPLOAD)

Initiating the SDK Shoot

Initiating the builder will start the SDK environment. Please check the testing flow here.

val spyne = builder.build()
spyne.start()

Setting up advanced configurations in Shoot Builder

Spyne SDK allows you to add advanced features as per your requirement. You can append these advance features in the Shoot Builder function before starting it, as shown below. To know more about the Advanced SDK configurations, please click here.

builder.uniqueShootId("myUniqueShootId").shootLocation(false)