Implementing Android POS Receipt Printing on Shopify - Shopify
Jun 5, 2019

Summary
This post details the implementation of receipt printing support for Shopify POS on Android. It outlines the five-step printing pipeline: Data Aggregation, Content Generation, Sections Definition, Print Request Creation, Content Rendering, and Receipt Printing. Key technical aspects include using a coroutine-based API for data aggregation, a PrintableReceiptComposer class for content generation with TDD, ViewBinder-like classes for section definitions, a printer-agnostic PrintRequest class, and rendering sections to in-memory Bitmaps. The Hardware SDK abstracts vendor-specific integrations. Testing relies heavily on unit tests for data aggregation and content generation, and screenshot tests for section definition and content rendering.