ePub library for java or android
Asked Answered
S

3

44

Is there any library to read ePub format? I found ePublib in http://github.com/psiegman/epublib. I'm still learning how to use it.

Is there ePub jar which works for Android?

Scotland answered 5/9, 2010 at 10:52 Comment(2)
How do you define "read ePub format"? What features and functions are you expecting this JAR to do for you? EPUB is simply a ZIP file containing HTML, CSS, images, and metadata.Knickerbockers
Which did you finally use and why?Smelser
B
55

I am the author of epublib. It now runs on Android. See http://www.siegmann.nl/epublib/android

Blues answered 8/9, 2010 at 19:3 Comment(7)
epublib loads the whole epub file into memory when reading an epub, while on Android available memory for each Application is quite limited, this means epublib cannot read big epub files.Introject
any other library with non GPL licence.Clanton
i had seen above link download jar file and epub file and put it into assest folder then run that code but it's give me error 01-29 18:21:58.241: E/AndroidRuntime(28179): java.lang.ExceptionInInitializerError can you help me abou itGudrin
I believe you can read chapter-by-chapter, as there is no such thing as "page" in epub. the pagination happens on your device depending on your screen/font size. Unless I've been grossly misinformed.Martins
@Shrenik: epublib is LGPL. While this is still a GPL-type license, it makes the library available to commercial/closed source projects.Dimorphous
I tried the above mentioned link, implemented every step mentioned there, but nothing is happening, just my main activity launch, although I used the source code mentioned int above mentioned url and also put and epub file under my asset folder.Natation
@Dimorphous It usually is the case, but Android integrates the library into its APK file. If I understood LGPL correctly, LGPL only allows the library file to be external, so that it can be replaced. But you cannot replace the LPGL library in an Android APK. So, LGPL is very shady when it comes to Android. I guess, probably my chance of getting sued by an LGPL author for using his LGPL library in my closed-source Android app, but who knows, if he really wants to screw me, he probably can.Drucie
B
7

You can use Folio Reader for this purpose. To use , add this to gradle:

compile 'com.folioreader:folioreader:0.2.5'

And if you have the .epub file in assets folder, you can load the file as :

Intent intent = new Intent(HomeActivity.this, FolioActivity.class);
intent.putExtra(FolioActivity.INTENT_EPUB_SOURCE_TYPE, FolioActivity.EpubSourceType.ASSESTS);
intent.putExtra(FolioActivity.INTENT_EPUB_SOURCE_PATH, "epub/The Silver Chair.epub");
startActivity(intent);

The library and sample is available [here].

The other available alternatives are:

Bogart answered 23/1, 2017 at 3:34 Comment(3)
Just a comment: epub3reader was a project of a couple of students I supervised ages ago. It is old, and not maintained. It was a proof-of-concept for some "advanced" usages of EPUB ebooks that unfortunately never caught on. Moreover, it uses Siegmann's EPUB library. I would not recommend digging it.Marden
I do not recommend FolioReader. It works, yes, but with so many crashes. Code quality is very poor, refactorings are even worse. I feel the guys have never head about OOP. I guess someone needs to sit and develop a new library ;)Virago
@Virago : which one do you guys suggest?Smelser
N
0

You can use one of the best epub sdk I found for epub, its also available for iOS ad desktop. Please check it here

//Example for playingn epub from asset folder. ls.installBook("file://android_asset/books/epub_cgfirstwordsattheaquarium.epub");

//Example for playing epub fromm network. ls.startDownload("http://scs.skyepub.net/samples/Alice.epub","","Alice's Adventures","Lewis Carroll");

//ls is an object of LocalService class which extends Service class.Please check sdk for complete information.

Github link https://github.com/xunuosi/SkyEpubForAndroid

Natation answered 26/11, 2019 at 7:58 Comment(1)
skyepub is so bad that the demo contains compilation errors!Addie

© 2022 - 2024 — McMap. All rights reserved.