Part 2- Reading Excel Sheet

Copied from More App

So, in today’s article you will learn reading of excel sheet in Android app with a very simple and easy way. To learn how to write excel sheet in Android please follow Part-1 of this article. To work with excel sheet first of all we need to add libraries from Apache POI.

//Apache POI for excel
implementation 'com.github.SUPERCILEX.poi-android:poi:3.17'
compileOnly 'org.apache.poi:poi-ooxml:3.17'

Prerequisites

Have previous knowledge about:
1- Kotlin
2- Read file in Android

Read Excel File

Read Excel Workbook

To read excel file, we first need to get file from app directory.

Convert Excel File to…


Part 1- Writing Excel Sheet

Copied from More App

So, in today’s article you will learn writing of excel sheet in Android app with a very simple and easy way. To do this, we need to add libraries from Apache POI.

//Apache POI for excel
implementation 'com.github.SUPERCILEX.poi-android:poi:3.17'
compileOnly 'org.apache.poi:poi-ooxml:3.17'

Prerequisites

Have previous knowledge about:
1- Kotlin
2- Save file in Android

Write Excel File

Create Excel Workbook

To create excel file, we first need to create Workbook from XSSFWorkbook and then need to create sheet to add data into it.

You can create multiple sheets in a single workbook by using the createSheet method…

Hafiz Faraz Tariq

Android dev | Data Scientist | Researcher

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store