Developing a Mobile E-Book Reader App
Making a simple reader that opens EPUB is a week's task. Making a reader that is pleasant to use is a different story. Smooth scrolling of long chapters, correct rendering of CSS from EPUB3, synchronization of reading position across devices, night mode without artifacts — each of these details requires individual solutions. For example, custom fonts from EPUB3 need CSS path normalization, and sync requires conflict resolution by timestamp.
Choosing the right rendering and sync stack saves up to 60% of debugging time. We use Readium Toolkit — a proven library that powers major readers (LitRes, Storytel). This choice guarantees stable support for EPUB 2/3, PDF, audiobooks, and built-in LCP DRM. With experience from over 10 reader projects, we are ready to offer optimal architecture.
Formats and Rendering
Primary formats: EPUB 2/3, PDF, FB2. MOBI and AZW3 on request.
Why Readium is the Best Choice for EPUB Rendering?
EPUB is a ZIP archive containing HTML/CSS/XML. Native rendering requires an intermediate layer. Readium is the de facto standard for mobile readers with open source. It supports EPUB 2/3, PDF, audiobooks, and LCP DRM. Readium Swift Toolkit (iOS) and Readium Kotlin Toolkit (Android) are used by LitRes Library, Storytel, and many others. Readium renders EPUB via an embedded WKWebView/WebView with its own JavaScript engine injection. This gives full support for book CSS, including custom fonts and complex typography.
// iOS — opening a book via Readium let publication = try await streamer.open(asset: bookAsset, allowUserInteraction: false) let navigator = try EPUBNavigatorViewController( publication: publication, config: .init( editingActions: EditingAction.defaultActions, fontOverrides: userSettings.fontOverrides ) ) Speed comparison: Readium renders EPUB 2x faster than a custom WebView parser with CSS injection without optimizations.
How to Handle PDF and FB2?
On iOS — PDFKit (native, fast, supports annotations). On Android — PdfRenderer (built-in, basic) or PdfiumAndroid for complex documents with vector graphics. For FB2, we use a custom XML parser with rendering via TextView (Android) / AttributedString (iOS). Or conversion to EPUB on server or device via fb2c or Calibre-like logic.
| Format | Rendering | Annotation Support | Complexity |
|---|---|---|---|
| EPUB 2/3 | Readium (WKWebView/WebView) | Yes | Medium |
| PDFKit (iOS) / Pdfium (Android) | Yes | Low | |
| FB2 | Custom XML parser | No (basic highlighting) | High |
Reading Settings
Font, size, line spacing, margins, theme (light/dark/sepia) — stored locally in UserDefaults / SharedPreferences and applied via CSS injection into Readium:
val preferences = EPUBPreferences( fontFamily = FontFamily.GEORGIA, fontSize = Percentage(1.2), lineHeight = Double(1.5), theme = Theme.SEPIA ) navigator.submitPreferences(preferences) Important: app theme and reader theme are separate. If a user reads in dark mode but switches the system to light, the reader should not automatically change theme. Reader settings are independent of system settings.
Progress and Bookmarks
Current reading position — Locator in Readium terminology. It is an object with href (chapter path), progression (0.0–1.0 within chapter), and a text fragment for precise restoration after book updates.
Bookmarks, annotations, highlights — stored in Room / Core Data as Annotation(bookId, locator, text, color, note).
How to Sync Progress Across Devices?
If sync is needed, position and annotations are sent to the server on each change. WorkManager / BGTaskScheduler sends accumulated changes when network is available. Conflicts are resolved by timestamp: the later position wins. Readium supports OPDS Annotations — if the server supports it, sync is almost free.
We guarantee sync won't cause data loss: we test on 10+ devices simultaneously.
Library and Downloads
Books are stored in Files (iOS) / filesDir (Android) — not cacheDir, otherwise the OS may delete them when space is low. On iOS 16+ you can use FileManager with ubiquityContainerIdentifier for iCloud file sync.
Download via URLSession.downloadTask (iOS) / DownloadManager (Android) with resume support (resumeData). Progress displayed in library. Full-text search inside EPUB — via indexing all chapter text into an FTS4/FTS5 Room table.
Typical Problems and Solutions
Custom fonts from EPUB3 (@font-face) fail to load if the CSS path uses ../Fonts/ — path normalization needed. WKWebView on iOS truncates long pages if isScrollEnabled = false — proper pagination configuration required. PDF with embedded CJK fonts on PdfRenderer Android gives rendering artifacts, so we use Pdfium. For each case we have internal utilities: CSS path normalizer, automatic WKWebView pagination config, and CJK font detector to switch to Pdfium.
What's Included in Development
- App architecture and rendering stack selection.
- UI/UX adaptation for iOS and Android.
- Integration of Readium Toolkit for EPUB/PDF and FB2 parser.
- Setup of progress and annotation sync via server.
- Implementation of reading settings (font, theme, margins).
- Testing on physical devices (at least 10 models).
- API and build documentation, source code and access transfer.
- 6 months free support after release.
Timelines
| Stage | Duration |
|---|---|
| Basic reader with EPUB/PDF, settings, bookmarks | 3–5 weeks |
| Full app with sync, full-text search, annotations, multi-format support | 8–10 weeks |
Cost is determined after defining format set and sync requirements. Get a consultation — we'll find the optimal solution. Order reader development with quality guarantee: we provide 6 months free support after release.







