A simple CSV Reader app made using MVVM, Repository Pattern, Hilt and Navigation Component.
Number of fields: The app can read any CSV with arbitrary number of fields per row.
Comma values: Fields can contain commas if they are surrounded in quotes. (Note: if ending quote doesn't exit, the remaining text in the row is considered one cell.)
Quote values: Quotes can be added by writing them 2 times. "" will become"
Configurable Options: Following can be configured in the code:
- Separator character
- Quote character
- Line break character
- Skip empty rows
- Skip missmatching rows (different number of cells than header row)
- Remove trailing spaces
Recycling UI: Cells in the table UI are recycled just like RecyclerView. This means larger files will not take up large amount of RAM by creating and holding views in memory.
The parser is separated out in a separate pure Kotlin module. This allows it to be reused in any platform. It can later on be published as a library itself.
- AndroidX - ViewModel, LiveData
- KotlinX - Coroutines
- Hilt - Dependency Injection
- Navigation Component - User navigation
- UI for changing the parser configurations.
- Huwaei Android 8: File Picker on this device didn't recognize csv files. Needs to be investigated.