GithubHelp home page GithubHelp logo

leanjiang / poi-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from supercilex/poi-android

0.0 0.0 0.0 123 KB

๐Ÿ“ˆ Apache POI for Android

License: Apache License 2.0

Kotlin 100.00%

poi-android's Introduction

POI Android

Build Status

POIA is a simple library enabling Apache POI usage on Android.

Table of Contents

Installation

Add JitPack to your repositories:

allprojects {
    repositories {
        // ...
        maven { url 'https://jitpack.io' }
    }
}

And the POIA dependency itself:

implementation "com.github.SUPERCILEX.poi-android:poi:$poiVersion"

If you're using proguard, also add:

implementation "com.github.SUPERCILEX.poi-android:proguard:$poiVersion"

If you want source code and documentation, add the real Apache POI dependency as compileOnly:

compileOnly "org.apache.poi:poi-ooxml:$poiVersion"

Updating Apache POI

If you need a newer version of Apache POI than is provided by this transpiler, updating is as simple as making a fork and changing a few lines of code:

  1. Fork the repo and update Apache POI
    1. PSA: you can find Apache POI release notes here
  2. Simply replace SUPERCILEX in the Gradle dependency with your own GitHub username
  3. That's it, it's that simple! ๐Ÿš€

Notes

XSSFWorkbook (*.xlsx) does not work on pre-L (API < 21) devices. A simple solution is to show the user some error message and gracefully downgrade to HSSFWorkbook (*.xls):

val workbook = if (isUnsupportedDevice) {
    showToast(getString(R.string.export_unsupported_device_rationale))
    HSSFWorkbook()
} else {
    XSSFWorkbook()
}

// Example unsupportedDevice property
val isUnsupportedDevice by lazy { VERSION.SDK_INT < VERSION_CODES.LOLLIPOP || isLowRamDevice }

Make sure to test your implementation thoroughly pre-L since HSSFWorkbook only supports a subset of the Workbook's APIs and might throw a UOE. Wikipedia even goes so far as to call it the "Horrible SpreadSheet Format" so consider yourself warned. ๐Ÿ˜

poi-android's People

Contributors

supercilex avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.