There are libraries for Java developers that have tons of methods which do not work on Android.
I started by working with libraries like OpenCSV, but unfortunately Excel has known issues with opening CSV files.
Then I tried to use:
- Apache POI - It definitely has too many methods.
- JExcelAPI - It works, but only on old binary .xls files.
- docx4j - again too many jars, because it's based on JAXB which is not included in Android.
My question is, how can I create a simple Excel file in .xlsx format on Android, without exceeding 65k methods?
I'm expanding on Axel Richter's answer My code below will add features for you to add columns and values dynamically.
import android.os.Build;
import androidx.annotation.RequiresApi;
import java.io.ByteArrayOutputStream;
It's 2018. Use Microsoft Graph API and create the Excel file in O365.
Microsoft has published a few examples in Angular and C#. It's not Java but it is a good starting point: https://developer.microsoft.com/en-us/graph/docs/concepts/excel-write-to-workbook.
The MS Graph Java SDK is Android compatible.
Limitation - there is no easy way to create an Excel file from scratch using the API. You may want to keep a blank workbook and clone it each time.