Capture Flow UI Guide
The Entrupy Android SDK's Capture Flow provides a guided, user-friendly interface for submitting items for authentication. It simplifies the process of capturing necessary images and metadata, aiming for successful submissions on the first attempt.
Overview
The Capture Flow is a full-screen activity or fragment that your application presents to the user. Key characteristics include:
- Guided Image Acquisition: Step-by-step instructions tailored to the item's brand and type, ensuring all required views are captured.
- Real-time Feedback: The SDK may incorporate client-side machine learning to provide instant feedback on image quality (e.g., blur detection, glare warnings, framing assistance). (Specific "smart capture" enhancements will be detailed as they become generally available.)
- Dynamic Image Requests: The system might request additional images during the capture session if more information is needed for a comprehensive assessment.
- Metadata Collection: Facilitates the input of necessary item metadata.
Upon successful completion, the Capture Flow submits the data to Entrupy for processing. An optional Results Screen can be displayed immediately, or your application can transition to a custom UI, often using the Detail View Controller to track the authentication status.
Initiating the Capture Flow
To start the Capture Flow, your application invokes the startCapture method on the EntrupyApp instance. This typically happens in response to a user action, like tapping an "Authenticate Item" button.
Prerequisites:
- Valid Authorization Token: Ensure the user is logged into the SDK and has a valid authorization token. See Session and Token Lifecycle Management.
- Context: You need a reference to the context that will be used to launch the Capture Flow activity.
- ConfigMetadata: Prepare a
ConfigMetadataobject containing metadata for the item being authenticated.
Method Invocation:
import com.entrupy.sdk.app.EntrupyApp
import com.entrupy.sdk.listeners.CaptureCallback
import com.entrupy.sdk.model.ConfigMetadata
import com.entrupy.sdk.model.ProductCategory
// 1. Prepare ConfigMetadata
val configMetadata = ConfigMetadata(
brandId = "nike",
productCategory = ProductCategory.Sneakers,
customerItemId = "SKU-INTERNAL-12345" // Your internal identifier (max 256 chars)
)
// 2. Check Authorization and Present
val entrupyApp = EntrupyApp.sharedInstance()
if (entrupyApp.isAuthorizationValid()) {
// 3. Start the Capture Flow (callback is optional)
entrupyApp.startCapture(
configMetadata = configMetadata,
callback = object : CaptureCallback {
override fun onCaptureStarted() {
println("Capture flow launched successfully")
}
override fun onCaptureError(errorCode: Int, description: String) {
println("Capture failed to start: $description")
showAlert("Error", description)
}
}
)
} else {
// Handle invalid or expired token: initiate re-authorization
println("Authorization token is invalid. Please log in again.")
}
ConfigMetadata Parameters:
brandId(String, required): The item's brand identifier (e.g., "nike", "louis_vuitton"). This influences the capture guidance.productCategory(ProductCategory, required): The product category—Luxury,Sneakers, orApparel.customerItemId(String, optional): A unique identifier your system uses for the item (max 256 characters). Highly recommended for tracking and duplicate prevention.modelId(String, optional): Optional model identifier for more specific configuration.modeId(String, optional): Optional mode identifier.
The Capture Process UI
Once startCapture is called, the SDK launches a full-screen activity guiding the user:
- Category/Type Refinement (If Applicable): For some brands with diverse product lines, the user might be asked to select a more specific item category (e.g., handbag, wallet, shoe type). This helps tailor the image capture sequence.
- Guided Image Capture: The core of the flow. The user is prompted to take specific photos (e.g., front view, back view, logo details, hardware, date codes, internal tags) according to on-screen instructions and visual guides.
- The SDK utilizes the device camera.
- Real-time assistance (smart capture features) may be provided to check for common issues like blur, glare, or poor framing. If an issue is detected, the user is typically prompted to retake the photo.
- Additional Images (If Prompted): Based on the initial set of images, the system might immediately request additional, specific photos to ensure a complete data package for robust authentication.
- Review and Submission: The user may have an opportunity to review the captured images before confirming submission. Once confirmed, the SDK uploads the images and metadata to Entrupy.
Captures not completed within 2 hours will automatically be aborted.
CaptureCallback Callbacks
To respond to events and outcomes from the Capture Flow, implement the CaptureCallback interface. The callback is optional.
import com.entrupy.sdk.listeners.CaptureCallback
class YourActivity : AppCompatActivity(), CaptureCallback {
// Invoked when the capture flow launches successfully
override fun onCaptureStarted() {
println("Capture flow started")
// The capture UI is now visible to the user
}
// Invoked if the capture flow fails to start
override fun onCaptureError(errorCode: Int, description: String) {
println("Capture failed: $description (Code: $errorCode)")
showAlert("Error", description)
}
}
Note: The
CaptureCallbackreports whether the capture flow started successfully. Final authentication results are delivered to your backend via webhook. Your app should display a pending state or use the Detail View to track status.
ProductCategory Options
The SDK supports three product categories:
import com.entrupy.sdk.model.ProductCategory
// Available categories
ProductCategory.Luxury // For luxury goods (handbags, accessories, etc.)
ProductCategory.Sneakers // For sneaker authentication
ProductCategory.Apparel // For apparel items (default)
// Utility methods
ProductCategory.all() // Returns list of all categories
ProductCategory.default() // Returns Apparel
ProductCategory.fromDisplayName("Sneakers") // Get by display name
Smart Capture Features
The SDK aims to incorporate "smart capture" features to enhance image quality and submission success rates. These may include:
- Real-time image analysis: Checks for focus, lighting, and framing issues.
- Automatic prompts for improvement: Guides users to correct detected issues on the spot.
These features are designed to create a smoother user experience and increase the accuracy of authentications.
Next Steps
- Understand the optional Results Screen UI for immediate post-capture feedback.
- Learn how to display ongoing progress and final results using the Detail View Controller.