Why I Built Hazeri This Way: Five Design Decisions for Offline Face Recognition

How did I build a face-recognition app that runs on a $100 phone with no internet — and what did I cut to get there?

Hazeri is a fully offline Android attendance app with face recognition that I built solo. This article isn't about performance numbers; it's about five design decisions: removing the INTERNET permission, WebView instead of native code, using the open-source Human library, IndexedDB storage, and three-layer liveness.

By Saman Ghahreman · Published: · 6 min read

Case studies and build experience

Most attendance software is cloud-first: monthly subscription, staff data on someone else's server, dead when the internet drops. Hazeri was a different answer: an old Android phone at the door, no internet, no stored photo. This article is the story of how I built it — five design decisions that shaped the project.

This is not a "30% faster, 2x more accurate" report. It's about decisions that are defensible and that any developer could repeat.

The problem I started with

Clinics, small workshops and shops still record attendance in a paper book or a chat group. When I asked a few business owners why, three answers came back: a colleague can swipe someone else's card; biometric devices are expensive and need wiring and a technician; and cloud services charge monthly, need internet, and "which server does my staff's face data live on?" is a question nobody could answer.

The goal became clear: a solution that runs on hardware they already own, needs no internet, and keeps biometric data on the device.

Decision 1: Remove the INTERNET permission from the AndroidManifest

This is the most important decision. Most apps say "we don't send your data," but that claim is not verifiable. I removed the INTERNET permission from AndroidManifest. The app can now technically not send any network request — not on purpose, not by mistake, not in a future version.

Any user can open Android Settings → Apps → Hazeri → Permissions and see this for themselves. Offline only means something when it is provable.

Decision 2: WebView instead of native Kotlin

The app is written inside a WebView — meaning the UI and logic are HTML and JavaScript running in an Android WebView. This has several advantages:

  • One codebase runs across Android 6 to 14; no separate versions for each Android release.
  • The same code can move to a browser PWA or an Electron desktop build with small changes.
  • UI updates are fast; changing HTML/CSS doesn't need an app recompile.

What I give up: access to low-level Android APIs (specific sensors, native GPU optimisation). For attendance, I didn't need those.

Decision 3: The Human library instead of a custom model

Training a good face-recognition model takes months, a huge dataset and expensive GPUs. The open-source [Human](https://github.com/vladmandic/human) library ships all that done: face detection, vector extraction, anti-spoof score, liveness challenges. MIT-licensed, light, runs in the browser.

The practical decision was: spend my effort on things where I actually add value — Persian UX, Persian-calendar reports, the three-layer liveness logic, threshold tuning for real conditions — not on rebuilding a wheel that already exists.

Decision 4: IndexedDB instead of SQLite

Data (staff, face vectors, daily records) is kept in IndexedDB, the browser's built-in database. This has several advantages:

  • Backup is a simple JSON file, not a binary; the user can export to Excel themselves.
  • No third-party library needed; IndexedDB is part of the browser itself.
  • Restore and migration between devices is straightforward.

What I give up: complex SQL queries. For an attendance use case, I didn't need those.

Decision 5: Three-layer liveness

During early testing, someone held up a phone with a colleague's photo and the first version accepted it. That was a hard moment; it questioned the whole idea. The fix is three layers:

  1. The Human library's built-in anti-spoof score (a number between 0 and 1 that estimates whether a face is "live" or a reflection from a screen).
  2. A random behavioural challenge: the app says "blink" or "turn your head left"; a static photo can't perform these.
  3. Identity stability across consecutive frames: one "similar" frame is not enough; the same face must persist for several frames.

This is enough for a small business. It is not enough for a bank or anywhere real money moves, and I say that openly on the product page. The Hazeri privacy policy repeats it.

Who it is for, and who it is not for

Good fitBad fit
Small workshopsBanks or high-security sites
Clinics and medical officesSeveral branches with one combined report (custom version needed)
Shops and cafésVery large staff (needs a different architecture)
Small training centersAutomatic payroll integration (can be custom-built)

What I cut (and why)

  • Multi-branch sync: this would need a server, and a server means a subscription — the opposite of the project's point. The default version is one independent device.
  • Remote admin dashboard: same problem. If a client wants it, it can be built as a custom version with a small server.
  • iOS version: Apple is strict about camera access in WebView and App Store access from Iran is limited. Possibly in a later version.
  • Storing the face photo: never. Only the numeric vector. That is itself a sales feature, not a limitation.

Three lessons I keep for future projects

First, "offline" only means something when it is provable. Removing the INTERNET permission from the AndroidManifest is what turns marketing into fact.

Second, WebView is not a bad choice for apps that don't need heavy native performance. One codebase across many Android versions.

Third, lean on open-source libraries where possible and focus your effort on what actually adds value.

Want the same for your business?

Get the free demo of the default Hazeri from the product page. If you see it suits your work but something is missing — multi-branch sync, payroll integration, remote admin dashboard — I build it as a custom project. The usual deal: you see a working sample before you pay.

If you run a training centre, a training-centre chatbot works alongside attendance, and if you need a custom model, see custom AI models. Does your own business need an app or system like this? You can start by working with Saman.

Frequently asked questions

Why use a ready library instead of training your own face-recognition model?

Training a good face-recognition model takes months and a huge dataset. The open-source Human library is good enough for a small business and MIT-licensed. I spent my time on things where I actually added value: three-layer liveness and Persian UX.

How do I prove the app is really offline?

Open Android Settings → Apps → Hazeri → Permissions. INTERNET is not in the list. The app technically cannot send any network request.

Can I order the same model for a different business?

Yes. The architecture is the same: on-device model, offline data, no INTERNET permission. Other uses: building access control, identity checks in online meetings, queue systems that recognise returning customers.

How many staff does it suit?

Designed for small to medium businesses. For very large numbers, a different architecture is needed and can be custom-built.

Sources

Tags: app case study · offline face recognition · Hazeri · privacy-by-design · lightweight Android app

Get advice on Custom AI Model Development

One short consultation is enough to clarify the path, timeline and rough cost of your project.

My promise
If you have a problem you think AI might solve, write to me. I’ll tell you honestly whether it will; sometimes the answer is no, and hearing that early is cheaper.
Book a consultation