CSV and Excel Data Import into Mobile App

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
CSV and Excel Data Import into Mobile App
Medium
~2-3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1050
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing Data Import (CSV, Excel) into Mobile App

Import — harder than export. When exporting, you control format. On import you get file user opened in Excel, renamed columns, added row "My data for 2024", saved in Windows-1251 and sent via Telegram. And all this needs to be recognized and loaded without crashes.

Parsing Incoming File — Most Unpredictable

Encoding detection. CSV comes in UTF-8, UTF-8 with BOM, Windows-1251, CP866. Universal solution — encoding detection library: on Android juniversalchardet, on iOS — own BOM analysis + fallback to String.Encoding.windowsCP1251. If encoding detected wrong — Клиент instead of "Client".

Delimiter detection. Parser should try ,, ;, \t and pick one giving most uniform columns. Or let user choose manually — more honest and reliable.

Empty rows, duplicate headers, mixed types. Real user files contain empty rows between blocks, merged cells in Excel, numbers in "date" column. Each needs explicit handling, not crash with ArrayIndexOutOfBoundsException.

Import Architecture

Step 1: File Selection

// Android — DocumentPicker
val launcher = registerForActivityResult(
    ActivityResultContracts.GetContent()
) { uri -> uri?.let { viewModel.importFile(it) } }
launcher.launch("text/csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
// iOS — UIDocumentPickerViewController
let picker = UIDocumentPickerViewController(forOpeningContentTypes: [.commaSeparatedText, .spreadsheet])
picker.delegate = self
present(picker, animated: true)

Step 2: Parsing

On Android for CSV — opencsv or univocity-parsers (latter faster on big files, handles quote escaping correctly). For .xlsx — Apache POI XSSFWorkbook.

On iOS for CSV — own parser via Scanner or CSVParser from SwiftCSV. For .xlsxCoreXLSX (Swift Package Manager).

// Android, univocity-parsers
val settings = CsvParserSettings().apply {
    isHeaderExtractionEnabled = true
    format.delimiter = ';'
}
val parser = CsvParser(settings)
val rows: List<Record> = parser.parseAllRecords(inputStream.reader(Charsets.UTF_8))

Step 3: Validation and Mapping

Before writing to database — validate each row. Not "crash on first error", but collect all invalid rows and show summary: "Imported 847 of 900 rows. 53 rows skipped — incorrect date format in column D". User should understand what went wrong and fix file.

data class ImportResult(
    val imported: Int,
    val skipped: List<SkippedRow>
)

data class SkippedRow(val line: Int, val reason: String)

Step 4: Database Write

Transaction as whole — either all or nothing. On Room:

@Transaction
suspend fun importRows(rows: List<TransactionEntity>) {
    database.clearAll()
    database.insertAll(rows)
}

For incremental import (add new, update existing) — INSERT OR REPLACE with unique identifier field.

UI Patterns

Progress bar with current row (Processed 3,412 of 10,000), cancellation via Job.cancel() on Android / Task cancellation on iOS. After import — summary screen: how many added, updated, skipped with reasons.

Preview first 5–10 rows before import confirmation — good UX practice reducing "I uploaded the wrong thing" cases.

Typical Mistakes

  • Parsing on main thread — ANR/freeze guaranteed on 1+ MB files
  • Unhandled quotes in CSV: "Ivanov, Ivan" without escaping breaks comma split
  • Date 01.03.2024 vs 2024-03-01 vs 3/1/24 — three formats, all appear in real files

Work Scope

  • File selection via DocumentPicker (CSV, XLS, XLSX)
  • Auto-detect encoding and delimiter
  • Validation with error report by rows
  • Transactional database write
  • UI progress and preview
  • Import cancellation support

Timeline

Basic CSV import with fixed structure: 1–1.5 days. With auto format detection, validation, preview and error report: 3–4 days. Cost depends on field mapping complexity.