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?

Merhawi Fissehaye
  • 2,482
  • 2
  • 25
  • 39
Faren
  • 1,285
  • 3
  • 15
  • 21

3 Answers3

55

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

Sergey Glotov
  • 20,200
  • 11
  • 84
  • 98
P. Siegmann
  • 689
  • 7
  • 3
  • 9
    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. – neevek Jan 13 '12 at 10:05
  • 1
    any other library with non GPL licence. – Shrenik Apr 18 '12 at 08:01
  • 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 it – PankajAndroid Jan 29 '13 at 12:52
  • 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. – nurchi Jul 05 '16 at 17:44
  • 1
    @Shrenik: epublib is *L*GPL. While this is still a GPL-type license, it makes the library available to commercial/closed source projects. – fiffy Dec 28 '16 at 08:17
  • 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. – shaby Nov 26 '19 at 09:14
  • @fiffy 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. – Damn Vegetables Aug 23 '21 at 09:03
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:

OBX
  • 6,044
  • 7
  • 33
  • 77
  • 5
    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. – Alberto Pettarin Mar 10 '17 at 10:33
  • 1
    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 ;) – NMP Jun 08 '19 at 05:05
  • @NMP : which one do you guys suggest? – Astha Garg Oct 27 '21 at 06:59
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

shaby
  • 1,301
  • 1
  • 15
  • 17