Android - epub reader to read .epub files..
Asked Answered
E

1

7

I am developing and EPUB reader. I want to know some things related to other EPUB readers there in the market (like Cool reader, FBReader, Amazon Kindle and many more).

  1. What type of view they use to show pages of .EPUB books?
  2. Is it normal textview, webview or something custom?
  3. How to implement search and bookmark functionality in epub reader as we loaded single html pages in webview?
  4. I want to know how to read epub ? Is there any api in Android?

Any better solution is appreciated.

Etan answered 3/12, 2011 at 8:12 Comment(0)
S
17

Look at Epublib – a java epub library it supports in the Android.

EPUB is simply a ZIP file containing HTML, CSS, images, and metadata.

So you can use WebView to display that HTML pages. Or possible convert it to in .png or bitmap then use in ImageView.

Spleen answered 3/12, 2011 at 8:16 Comment(10)
do you know how do I refer to css using epublib ?Etan
No, But In my project I unzipped .epub file and use it html file to display in webview, So I can also manage its other functionality, like text highlight, page bookmark etc.. , Hope this info help you.. Thanks...Spleen
epublib FAQ says about this, How do I display a book’s images on Android ? Make a subclass of android.webkit.WebView that overloads the loadUrl(String) method in such a way that it loads the image from the Book instead of the internet do you know any example of this ?Etan
I have used same library in my Android project. I have kept my epub file in Assets directory in my project. I am able to receive Table of Contents. I am also able to receive name of html file associated with particular resource but I am stuck on how to load that file in webview, as I do not have absolute path of the file. Please can you help me to get rid of this issue?Justifiable
okay.. so suppose i have put it in sdcard in directory say /hp/epubs/test.epub. Now in that suppose I have html file named as abc.html. So shall I load directly in webview as webView.loadURL("/hp/epubs/text.epub/abc.html"); or what path to give?Justifiable
@Justifiable - give this path Environment.getExternalStorage().getAbsolutePAth()+"/hp/epubs/text.epub/abc.html"Spleen
@Spleen can you tell me how can I implement bookmark functionality ? I need to take text from webview and save it to database/ file. How can I do that ? I need that text to show to user that user have bookmarked something.Etan
Use android clipboard for copy text from webview's webpage and save it in database.. The selected text make a first word of loaded page, Or if you display data in webview take first word from that data.. For bookmark use scroll position and webpage number.. in normal mode (No zoom effect..)Spleen
I didn't understand using clipboard. What text should I copy to clipboard ? Lets say I scroll down webview where my scroll position is different than 0, and text which I can see is not the 1st word from webview. and then I click bookmark, how such case can be handled ?Etan
@Spleen Can you give me your email? I want to ask you some basic but important question about epub reader base on WebView.Swayder

© 2022 - 2024 — McMap. All rights reserved.