2026-01-24//LOG
Kotlin on Sunmi POS: The Android You Never Wanted to Write
Writing Kotlin for Sunmi POS terminals is like Android development but everything is trying to kill you.
The Sunmi V2 Pro runs Android 7.1. SEVEN POINT ONE. That is from 2017. Half the Jetpack libraries do not support it. You are writing Kotlin with one hand tied behind your back because your target API level is from the era when people still thought Android Wear was going to be a thing.
The thermal printer is the star of the show. It runs on a system service that blocks the main thread for 200-400ms every time it prints a receipt. You WILL get ANR dialogs if you are not careful. Our solution: coroutine-based print queue that offloads everything to a background dispatcher. Sounds simple. Took two weeks to get right because the Sunmi SDK documentation is written in a language that is technically English but spiritually Mandarin.
Payment integration is where it gets spicy. Stone, Rede, Cielo, each payment provider has their own SDK with their own lifecycle, their own callback patterns, and their own creative interpretation of what "success" means. We built an abstraction layer that normalizes all of them into a single PaymentResult sealed class. Every new provider is just a new adapter. Clean Architecture saves lives here.
The 5.5 inch screen is the constraint that shapes everything. No room for fancy layouts. Every pixel matters. We learned to design for the terminal first and then adapt for tablets, not the other way around. Restaurant staff are using this thing during a Saturday dinner rush with greasy hands. Big buttons. Clear feedback. Zero ambiguity.
Testing on real hardware is non-negotiable. The emulator lies to you. It does not have the thermal printer. It does not have the NFC reader. It does not have the specific timing quirks of the Sunmi Android fork. We keep four physical terminals on the team's desks and every PR gets tested on metal before merge.
It is not glamorous work. Nobody writes Medium articles about Kotlin on a restaurant POS. But this code processes real money for real restaurants every single day, and when it breaks, someone does not get paid. That changes how you write every line.