Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Things I got careful about while building an offline estimate app with Expo

Lately I've been building Tarifo , an Android app for people who price a job before doing it: plumbers, electricians, painters, cleaners, freelancers. You write the estimate at the customer's place, send it as a PDF on WhatsApp or by e-mail, and turn it into an invoice when they say yes. There's no account and no backend. Everything happens on the phone, and it has to work with no signal, because…

Building an offline estimate app with Expo led to several important considerations. Money is stored as an integer, with the number of decimals determined by the currency. For example, Japanese yen uses no decimals, while Kuwaiti dinar uses three. This requires a separate module to handle conversions between user input and stored data.

All calculations in the app are performed using integers, with rounding happening at a single known step. This ensures that totals, discounts, and taxes remain accurate, even when displayed on-screen or in a PDF.

Each document number is unique and incrementing, starting from EST-0008 after deletion of the previous document. Gaps in the numbering are acceptable, as documents keep their own copies of customer information, currency, and tax labels at the time of creation. This ensures consistency, even if the customer's details change later. A challenge remains in handling saved items with prices but no currency, which could be revisited as a product question.

The PDF preview and the actual PDF are created from the same document, but they may diverge if changes are made to one without updating the other. To prevent this, the preview and PDF template should always be updated together in a single commit. When printing, certain design elements may be lost, such as background colors in PDFs.

This requires checking the printed version for accuracy, particularly for long documents that may break across pages differently between A4 and US Letter formats. Arabic layouts will need special attention, as they mirror the entire layout rather than just changing text direction.

Sharing the PDF with a message is crucial, as estimates sent as plain PDFs can appear as spam. Adding a message to the share sheet in the Android platform can be achieved with a small patch to the sharing module. If a translated message is not available for a specific language, sharing the PDF alone without an English message is preferable. These solutions are straightforward, focusing on consistent representations and thorough testing to ensure a reliable offline estimate app experience.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

iPhone Face ID Not Working? 7 Fixes That Work

Face ID suddenly stops unlocking your iPhone, or it fails every time and asks for your passcode instead. This is often caused by a dirty camera, a screen protector covering the sensor, a change in…

  • Clean TrueDepth camera area with soft cloth to remove obstructions
  • Ensure Face ID is enabled in Settings Face ID & Passcode
  • Update iOS to latest version for potential Face ID fixes

Approved, but Locked Outside My Own House 🐝🔑

Sorry for my absence 😅 I was busy finishing something: a WordPress plugin for BeeLadybug, written in PHP. Just a small first piece, but mine. 🐞 Here's how it went.

  • WordPress plugin BeeLadybug approved by WordPress.org
  • Antonio Prosperi's account blocked after plugin submission
  • BeeLadybug inspects WordPress sites for layout issues

More from Tuesday, 1 December 2026 →