Overview
Receipt scanning uses your phone’s camera and OCR technology to extract expense details automatically. Point your camera at a receipt, and Divvy will detect the total amount, merchant name, and individual line items.How It Works
Receipt scanning leverages CameraX (Android’s modern camera library) with ML-powered text recognition to identify:- Total amount
- Merchant/store name
- Individual items and prices
- Tax and tip amounts
Receipt scanning works best with clear, well-lit photos of printed receipts.
Scanning a Receipt
To scan a receipt:- From the expense creation screen, tap the camera icon
- Grant camera permission when prompted (required for first use)
- Position your receipt within the on-screen frame
- Align the receipt so all text is visible and level
- Tap the capture button (large amber circle)
- Wait 2-3 seconds while Divvy processes the image
Visual Guidance
The scanner provides helpful guides:- Frame overlay: White corner brackets show the optimal capture area (260dp × 320dp)
- Auto-detect indicator: “Auto-detect ON” badge shows scanning is active
- Status text: “Align receipt within frame for best results”
Scanning Flow
Camera Permission
On first use, you’ll be asked to grant camera access. Divvy uses the
CAMERA permission to access your device camera.Position Receipt
Place the receipt flat on a surface or hold it steady. Make sure:
- All text is readable
- The receipt fits within the frame
- Lighting is adequate
- There’s no glare or shadows
Capture
Tap the amber circular button to capture the image. The camera will freeze and begin processing.
Processing
Divvy analyzes the image and extracts:
- Total amount
- Merchant description
- Individual items (if using itemized split)
Extracted Data
After scanning, the following fields are populated:- Amount:
$47.83(automatically formatted) - Description:
"Dinner at Maple Bistro"(merchant name from receipt) - Items (if itemized split): Individual line items with prices
Editing Scanned Data
You can review and edit all scanned data before creating the expense:- Tap the amount field to adjust the total
- Tap the description to change the merchant name
- When using Itemized Split, you can:
- Edit item names
- Adjust item prices
- Add or remove items
- Assign items to specific people
Always double-check scanned amounts for accuracy. OCR isn’t perfect and may misread damaged or poorly printed receipts.
Tips for Best Results
Lighting
Lighting
- Use natural light or bright indoor lighting
- Avoid harsh shadows across the receipt
- Turn on flash if the receipt is dark or faded
Receipt Condition
Receipt Condition
- Flatten crumpled receipts before scanning
- Smooth out folds that obscure text
- Ensure thermal receipts haven’t faded
Camera Angle
Camera Angle
- Hold your phone directly above the receipt (birds-eye view)
- Keep the camera parallel to the receipt surface
- Avoid tilting or angling the camera
Receipt Placement
Receipt Placement
- Center the receipt within the frame guides
- Ensure all edges are visible
- Remove background clutter
Supported Receipt Formats
Receipt scanning works with:- Printed paper receipts (thermal or ink)
- Restaurant bills
- Grocery store receipts
- Retail purchase receipts
- Itemized invoices
Alternative: Gallery Upload
If you already have a photo of your receipt:- Tap the gallery icon (left of capture button)
- Select a receipt image from your photo library
- Divvy will process it the same way
Technical Implementation
Receipt scanning uses:- CameraX: Modern Android camera API for preview and capture
- ProcessCameraProvider: Manages camera lifecycle
- Back camera:
CameraSelector.DEFAULT_BACK_CAMERA - Text recognition ML: Extracts structured data from images
~/workspace/source/app/src/main/java/com/example/divvy/ui/scanreceipt/Views/ScanReceiptScreen.kt:1
Troubleshooting
If scanning fails:- Ensure camera permission is granted in Settings > Apps > Divvy > Permissions
- Try scanning in better lighting
- Manually enter the amount if OCR can’t read the receipt
- Use the gallery option if live scanning doesn’t work