Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages

Build guide

Building a phone-financing app that can lock a device

In short

A device financing lock system has three parts: an Android agent that is the Device Owner, a server that tracks payments and sends lock commands, and a staff dashboard. The hard part is a lock that survives reboots and bad networks. Expect roughly 12-18 weeks for a first release.

Who this is for

Founders of shops or lenders who sell phones on installments and want a system that restricts a device when payments lapse.

What the product has to do

  • Android agent (Device Owner)A native app that is set up as the device's policy controller and enforces what the server says.
  • Kiosk lock screenA full-screen lock the user cannot dismiss, with a clear message on how to pay and who to contact.
  • EnrolmentLinks a physical device to a customer account and a financing contract using a secret.
  • Heartbeat and telemetryA regular check-in that reports device state, such as SIM details, so staff can spot tampering.
  • Payment ledgerInstalments, due dates and recorded payments, which decide whether a device should be locked.
  • Operations dashboardStaff search devices, lock or unlock them, record payments and see which devices have gone quiet.
  • Audit trailEvery lock, unlock and override with who did it and when, for disputes.
  • Release and update channelA way to roll out agent updates safely to devices that cannot easily be reached by hand.

The stack, and why

LayerChoiceWhy
APINestJS with TypeScript, TypeORMStructured modules for contracts, devices and commands.
DatabaseMySQLContracts, instalments and device records are relational and need clean history.
DashboardReactA staff-facing operations tool with tables, filters and one-click actions.
Device agentNative Android in Kotlin using a Device Policy ControllerDevice-owner features and kiosk lock are system APIs, so a cross-platform wrapper adds risk rather than saving time.
HostingA Linux server with PM2Simple and cheap to run. Today I would add a managed queue and alerting for missed heartbeats from the start.

What ships first, and what waits

Version one

  • Enrol a device and show it in the dashboard
  • Heartbeat from the agent about every ten seconds
  • Manual lock and unlock from the dashboard
  • Kiosk lock screen with payment instructions
  • Automatic unlock when a payment is recorded

Later

  • Automatic locking from due dates
  • SIM-change and tamper alerts
  • Agent self-update
  • Customer-facing payment status page
  • Reports for lenders

Build order and timeline

  1. 2-3 weeksFeasibility on real handsetsProof that provisioning, kiosk lock and reboot persistence work on the phone models you will sell.
  2. 4-5 weeksServer and dashboardContracts, instalments, commands and staff screens.
  3. 4-6 weeksAgent hardeningHeartbeat, offline behaviour, battery tests and tamper handling.
  4. 2-4 weeksPilot with a shopA small batch of financed phones with staff trained on the process.

Want a number for your own scope? The app cost calculator turns platforms and features into an estimate.

Rules you cannot skip

  • Kiosk lock is a Device Owner feature

    Android's lock task mode only runs apps that a device policy controller has allowlisted, and it is meant for dedicated devices. Plan your provisioning around a fully managed device, not a normal user install.

    Official source
  • Custom policy controllers and Android Enterprise

    Android Enterprise is no longer accepting new registrations of custom DPCs to the Play EMM API. If you plan to distribute through Android Enterprise, read Google's DPC approval page first.

    Official source
  • Play Store financial features

    Google Play bans apps that expose users to deceptive or harmful financial products, requires apps with financial features to complete a declaration in Play Console, and requires you to follow local rules in every region you target. The policy does not name device financing, so ask Google through Play Console support if your agent will ship there.

    Official source

Where these projects go wrong

  1. Lock that does not survive reboot or no network

    Holding the kiosk lock through restarts and network drops is the core engineering problem. Test on every handset model you will finance.

  2. Battery drain from the heartbeat

    A regular check-in costs power. Measure it on old, cheap phones, not only on the one on your desk.

  3. Locking a customer who has paid

    Payment recorded late or in the wrong place leads to angry customers. Make unlock instant and give staff an override with an audit entry.

  4. Customers who dodge tracking

    Telemetry such as SIM serial helps staff notice a device that is trying to escape, but only if someone is alerted when it goes quiet.

  5. Unclear contract and consent

    A lock the buyer did not clearly agree to is a legal and reputational problem. Have the financing contract and the on-screen notice reviewed by a lawyer in your market.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.

Problems you will meet on this stack

Next step

Have a product like this in mind?

Send me a few lines on what it must do. A discovery call within 48 hours.