Skip to main content

Paper Receipt Android SDK 2.3.1

tip

A newer release is available. Paper Receipt Android SDK 2.4.0 adds the receipt-level return flag and camera UI support for Activation's Error Flows.

2.3.1 builds on 2.3.0 and ships together with Activation SDK 1.1.2. Its headline changes:

  • A refreshed camera UI. The paper and Activation camera screens are now one unified experience, with a one-time guide on first launch, an in-camera hint button, and new default colors.
  • No more launch crash under R8 full mode. Apps minified in R8 full mode — the Android Gradle Plugin default — could crash on launch; the SDK now publishes the keep rule that prevents it.
warning

This release contains breaking changes in blinkreceipt-camera-ui. Several resources behind the previous camera UI were removed, BlinkTooltip is no longer a styleable, and the default accent color changed. An app that only overrides strings or styles keeps building but can silently lose overrides whose keys are gone. See Breaking changes and the Upgrade checklist.

Installation​

Bump the BOM to 2.3.1. If you also use the Activation SDK, bump its BOM to 1.1.2 at the same time (see the Android SDK Version Matrix).

build.gradle.kts
dependencies {
implementation(platform("com.microblink.blinkreceipt:blinkreceipt-bom:2.3.1"))
implementation("com.microblink.blinkreceipt:blinkreceipt-recognizer")
implementation("com.microblink.blinkreceipt:blinkreceipt-camera-ui")

// Only if you use Activation
implementation(platform("com.actualplatform:activation-bom:1.1.2"))
implementation("com.actualplatform:activation")
}

compileSdk 37 (or higher) and minSdk 24 are required. Your app's targetSdk does not need to change.

blinkreceipt-camera-ui now has runtime dependencies on Coil (coil-compose, coil-gif) for the guide's animations, androidx.datastore:datastore-preferences to remember that the guide was shown, and androidx.compose.foundation. They are brought in automatically.

Breaking changes​

All of these are in blinkreceipt-camera-ui. The Camera Theme Customization guide walks through migrating a theme by what you'll observe after upgrading.

Camera UI resources removed​

The redesign replaced most of the camera screen and the resources behind it. Overrides of these keys no longer take effect, and direct references to the drawables no longer compile:

KindRemoved
Stringsrecognizer_receipt_edge, recognizer_camera_initial_instruction, recognizer_move_closer_suggestion, recognizer_move_further_suggestion, recognizer_results_frames_scanned
Drawablesdefault_secondary_button_background, ic_torch_selector, primary_secondary_color_selector, tooltip_secondary_action_button_selector
Colorssee_through_white, blink_blue_tapped, chip_background
Dimenssecondary_btn_diameter, primary_btn_diameter

BlinkTooltip is no longer a styleable​

tooltipPointHeight, tooltipBoxRadius, tooltipColor, and tooltipTextColor are now top-level attributes. Setting them in a theme works as before, but R.styleable.BlinkTooltip no longer exists, so code that references it no longer compiles.

The default accent color is cobalt​

BlinkRecognizerStyle now defaults colorPrimary to the new blink_cobalt (#0062F2) instead of blink_blue (#48B2E8), and no longer sets colorPrimaryVariant. An app that relied on the SDK's default accent now renders cobalt; an app that sets its own colorPrimary is unaffected.

Button style background and image items dropped​

The default torchButtonStyle, cancelButtonStyle, finishButtonStyle, retakeButtonStyle, captureButtonStyle, and confirmButtonStyle no longer set android:background or android:src. Both have been ignored since 1.9.10. Style the buttons with android:colorAccent, android:colorPressedHighlight, and android:colorActivatedHighlight, and the torch with torchOnSrc / torchOffSrc.

What's new​

  • One-time camera guide. A two-page fullscreen walkthrough — aligning the receipt's edges, then capturing a long receipt in several photos — appears before the camera opens on first launch. It never appears twice, and neither the camera nor its permission prompt starts until the guide is dismissed. Its text is overridable through recognizer_guide_page_one_label, recognizer_guide_page_two_label, recognizer_guide_skip, recognizer_guide_next, recognizer_guide_back, and recognizer_guide_done.
  • In-camera hint button. A new button opens a "How to scan a receipt" dialog. Style it with the new hintButtonStyle theme attribute (default Widget.AppCompat.ImageButton.HintButtonStyle); its icon is ic_hint, its content description cd_hint, and the dialog's text uses the cd_dialog_how_to_scan_* strings. See hintButtonStyle.
  • TooltipCharacteristics.Builder.displayDataMissingTooltip(Boolean). Turns on the "No receipt detected" tooltip, which previously could not be enabled. It defaults to false, matching previous behavior.
  • More scan detail for Activation. Scans submitted to Activation now also carry trip and item confidence, the authorization ID and auth code, the purchase country, and the purchase time.

Changed​

  • Camera UI copy. recognizer_blurry_image_tooltip now reads "The image is a bit blurry. Try retaking the photo for a clearer result."; recognizer_missing_data_tooltip reads "No receipt detected. Please try again."; and recognizer_camera_long_receipt_add_photos_hint reads "Long receipt? Take multiple photos." The new recognizer_finding_receipt_suggestion ("Finding your receipt…") replaces the move-closer and move-further prompts.
  • Tooltip appearance. The tooltip's corner radius changed from 6dp to 16dp, and it now draws white text on a dark scrim instead of following colorPrimary / colorOnPrimary.
  • androidx.work 2.10.0 → 2.11.2. This is the first line that brings Room 2.7.0 and its corrected keep rule (see Fixed).
  • Gson is declared explicitly at 2.14.0, instead of being inherited through Retrofit, so the version your app resolves no longer depends on another library's dependency graph.

Fixed​

  • Launch crash under R8 full mode. An app minified in R8 full mode — the Android Gradle Plugin default — could crash on launch with NoSuchMethodException: androidx.work.impl.WorkDatabase_Impl.<init> [], because Room's keep rule before 2.7.0 let R8 drop the constructor WorkManager's database is created with. The androidx.work update fixes it, and the corrected rule is now also published in the SDK's own consumer rules, so it stays in place even if your app pins an older Room. No integration changes are required.
  • hintButtonStyle overrides were ignored. The hint button read torchButtonStyle's attributes, so overriding its colorAccent, colorPressedHighlight, or padding had no effect.
  • The camera guide dismissed on a fixed delay. It now waits for its exit animation to finish, so it no longer leaves a blank gap with animations turned off or tears down mid-slide at a slower animator duration scale.
  • A corrupted preference store showed the camera guide on every launch. The guide now treats unreadable state as already shown.
  • Camera UI layout and theming fixes: the main action button's bottom spacing, the tooltip's placement, the edge-alignment state, the vertical offset of the last confirmed image, the scrim overlay's border color, and capture button theme attributes that were swapped.

Upgrade checklist​

  • Bump the Paper Receipt BOM to 2.3.1 — and, if you use Activation, the Activation BOM to 1.1.2, working through the Activation 1.1.2 upgrade checklist.
  • Search your app for the removed camera UI strings, drawables, colors, and dimens, and for R.styleable.BlinkTooltip; replace them with your own resources.
  • If you relied on the SDK's default accent color, set colorPrimary yourself or accept cobalt.
  • Move any android:background / android:src button styling to the colorAccent / colorPressedHighlight / colorActivatedHighlight and torchOnSrc / torchOffSrc attributes.
  • Review the camera on first launch: the one-time guide now appears before the camera and its permission prompt.
  • Translate or override the new guide, hint, and recognizer_finding_receipt_suggestion strings if you localize the camera UI.