{"id":15346677,"url":"https://github.com/centic9/poi-on-android","last_synced_at":"2025-05-16T01:06:59.501Z","repository":{"id":44574902,"uuid":"59965052","full_name":"centic9/poi-on-android","owner":"centic9","description":"A sample project that shows how Apache POI can be used in an Android application","archived":false,"fork":false,"pushed_at":"2025-04-05T07:59:49.000Z","size":1783,"stargazers_count":370,"open_issues_count":7,"forks_count":90,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-08T12:06:26.554Z","etag":null,"topics":["android","android-application","apache-poi","poi","sample-app"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/centic9.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"centic9"}},"created_at":"2016-05-29T21:42:17.000Z","updated_at":"2025-04-05T07:59:53.000Z","dependencies_parsed_at":"2024-01-03T08:25:15.162Z","dependency_job_id":"7e5f1bb8-555c-4bf6-9789-0d0c61b63008","html_url":"https://github.com/centic9/poi-on-android","commit_stats":{"total_commits":219,"total_committers":6,"mean_commits":36.5,"dds":0.182648401826484,"last_synced_commit":"d468b7fb1aae77443a164466c6dc7460b79b400b"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centic9%2Fpoi-on-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centic9%2Fpoi-on-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centic9%2Fpoi-on-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centic9%2Fpoi-on-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centic9","download_url":"https://codeload.github.com/centic9/poi-on-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448579,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-application","apache-poi","poi","sample-app"],"created_at":"2024-10-01T11:25:59.325Z","updated_at":"2025-05-16T01:06:54.489Z","avatar_url":"https://github.com/centic9.png","language":"Java","funding_links":["https://github.com/sponsors/centic9"],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/centic9/poi-on-android/actions/workflows/build.yaml/badge.svg)](https://github.com/centic9/poi-on-android/actions)\n[![Gradle Status](https://gradleupdate.appspot.com/centic9/poi-on-android/status.svg?branch=master)](https://gradleupdate.appspot.com/centic9/poi-on-android/status)\n[![Release](https://img.shields.io/github/release/centic9/poi-on-android.svg)](https://github.com/centic9/poi-on-android/releases)\n[![GitHub release](https://img.shields.io/github/release/centic9/poi-on-android.svg?label=changelog)](https://github.com/centic9/poi-on-android/releases/latest)\n\nThis is a sample Android application to show how\nApache POI can be used on Android.\n\nIt consists of two projects:\n* __poishadow__: A small helper project to produce\n  a shaded jar-file for Apache POI which includes\n  all necessary dependencies and fixes a few things\n  that usually hinder you deploying Apache POI on\n  Android\n* __poitest__: A very small sample Android application\n  which performs some actions on XLSX-, PPTX and DOCX-files using\n  Apache POI. See `MainActivity` for the actual\n  code\n\n#### Getting started\n\n##### Necessary System-Properties\n\nIn order to work around problems with finding a suitable XML Parser, currently\nthe following system properties need to be set manually during startup of your\napplication (let me know if you know of a better way to do this, see issue #10)\n\n    System.setProperty(\"org.apache.poi.javax.xml.stream.XMLInputFactory\", \"com.fasterxml.aalto.stax.InputFactoryImpl\");\n    System.setProperty(\"org.apache.poi.javax.xml.stream.XMLOutputFactory\", \"com.fasterxml.aalto.stax.OutputFactoryImpl\");\n    System.setProperty(\"org.apache.poi.javax.xml.stream.XMLEventFactory\", \"com.fasterxml.aalto.stax.EventFactoryImpl\");\n\n##### Supported Android versions\n\nThe sample project uses minimum SDK version 26, which maps to Android 8.0. Higher versions should work as well, \nolder ones are likely not supported any more.\n\n##### Dependencies\n\nNote: Some dependencies of Apache POI are not included in the shading to keep it's size at bay. If you use code\nareas which require `curvesapi`, `commons-codec` or any of the other dependencies, you may need to add\nthem in your Android application in addition to the poishadow-all.jar file dependency.\n\n##### Missing java.awt classes\n\nUnfortunately Android does not provide any of the classes in package `java.awt` and \nthus any code which uses code from there will not work. This affects various places\nin Apache POI, e.g. when handling column-width, images or other graphical operations.\n\nA few classes have been re-implemented in the src-folder in project `poishadow`. If you\nare missing some you might be able to add re-implementations for more there.\n\nWe do not plan to fix all of these in this sample application, if you need more, feel\nfree to add it and send PRs if you think it is generally useful.\n\n##### Use a pre-built jar\n\nIf you want to get started quickly, there is a ready-made jar-file available in the \n[release section](https://github.com/centic9/poi-on-android/releases), however this is\nnot updated frequently, so it may be somewhat outdated at times. \n\nYou should be able to simply add this to your Android project and use the Apache POI\nclasses from it.\n\n##### Build the jar yourself\n\nIf you would like to get the most recent jar or if you would like to change how the \njar-file is built,  e.g. if you need classes that\nare excluded, use a different version of POI or would like to adjust the build in some\nother way, you can build the shaded jar with the following steps:\n\nPreparation:\n\nYou will need the following pieces in order to get started\n\n* A recent Java SDK, preferably Java 8\n* An installation of the Android SDK, either the one included\n  with Android Studio or a separate download, see\n  https://developer.android.com/studio/index.html#downloads\n\nGet the code:\n\n    git clone https://github.com/centic9/poi-on-android.git\n    cd poi-on-android\n\nConfigure where your Android SDK resides:\n\n    echo \"sdk.dir=/opt/android-sdk-linux\" \u003e local.properties\n\nConfigure the version of the Android Build Tools that you have installed.\n\n    vi poitest/build.gradle\n\nThen build the shadow-jar (for some reason this works better if executed separately):\n\n    ./gradlew shadowJar\n\nFinally run the build and some testing. Make sure you have a device connected, e.g. the Android emulator.\n\n    ./gradlew build connectedCheck\n\nFor only the jar-files just run `build`\n\n#### Support this project\n\nIf you find this tool useful and would like to support it, you can [Sponsor the author](https://github.com/sponsors/centic9)\n\n#### Run the Android emulator\n\nList available emulators\n\n    \u003candroid-sdk\u003e/tools/emulator -list-avds\n\nStart an Android emulator\n\n    \u003candroid-sdk\u003e/tools/emulator -avd \u003cname\u003e\n\nInstall the apk\n\n    \u003candroid-sdk\u003e/platform-tools/adb install ./poitest/build/outputs/apk/poitest-debug.apk\n\n#### Notes\n\n* You can use the resulting jar-file `poishadow/build/libs/poishadow-all.jar`\n  in your own project, the code in directory `poitest` is\n  just a small sample Android application to show that it works.\n* This was only tested in Android Studio with the Android\n  emulator until now, should work on real Android as well, though!\n* Tested with `targetSdkVersion 26` and `minSdkVersion 26`\n\n#### Todo\n\n* Add more actual functionality to the sample application,\n  currently it just performs some basic functionality on\n  documents.\n* Some parts of the JDK are missing on Android, e.g. AWT-related classes.\n  Some of these are missing when some functionality of Apache POI\n  is used and thus currently crash the sample project. \n  There are some libraries which provide these classes, but none\n  was in a state that allowed it to easily integrate it here.\n\nPR which improve on these items are welcome.\n\n#### Links\n\n* https://github.com/FasterXML/aalto-xml\n* https://github.com/johnrengelman/shadow\n* http://www.mysamplecode.com/2011/10/android-read-write-excel-file-using.html\n* http://blog.kondratev.pro/2015/08/reading-xlsx-on-android-4-and-hopefully.html\n* https://github.com/andruhon/android5xlsx\n* http://stackoverflow.com/questions/8493507/trying-to-port-apache-poi-to-android\n* http://www.cuelogic.com/blog/creatingreading-an-excel-file-in-android/\n* http://en.b-s-b.info/office/excel/java-excel-poi.html\n\n#### Licensing\n\n   Copyright 2015-2024 Dominik Stadler\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentic9%2Fpoi-on-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentic9%2Fpoi-on-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentic9%2Fpoi-on-android/lists"}