smartmobilefactory / EpubReaderAndroid

MIT License
24 stars 7 forks source link

Usage questions #8

Closed voipworld closed 6 years ago

voipworld commented 6 years ago

hello, i have two usage questions hope to get it ;)

  1. is it pocible to provide a uncompressed ePub book to the EpubView inside a folder, or must i provide only .epub file? if no, can you implement a way to provide a uncompressed ebooks to the view? i ask this question, because there's some pretty large ebooks, that some of them have 16 to 20Parts inside them, each book can have up to 800pages opening those book inside the view take a long time thant expected, sometime up to 5 minutes or more so, providing uncompressed folder to the view could be a better way or maybe, uncompressing the book one time and keeping it in asset or something?

  2. if i want to save the Current page of the book in a Shared Preferences, could you provide a example for this? saving the page then going back to it up on opening the app is ideal... thanks!

timfreiheit commented 6 years ago

hi,

  1. To parse the epub we use the library epublib. Unfortunately it only supports reading the .epub files. We cached the unzipped epub in the cache directory which improves the secondary loading time a lot. To support loading pubs from uncompressed epubs we need to change the underling implementation.
  2. when setting the epub by using setEpub(epub, location) you can specify the first location which should be displayed. You get the current location from epubView.currentLocation() or epubView.currentChapter(). There is no direct mapping from EpubLocations to a string representation and you need to provide your own depending how you want to persist this. But this should be easily done considering the most important types are ChapterLocation and XPathLocation. What you want to save in preferences depends highly on your use case. Using the XPathLocation should only be used when the epub is unchangeable. Otherwise you need to transform it in what you need or just use the last chapter.
voipworld commented 6 years ago

Hello returning back to the decompression, see how much it take in this book: http://d.shamela.ws/epubs/072/7289.epub this is from a global library thanks.

gaoyx-tech commented 6 years ago

hello,when i use your epub lib,it crashed ,the error info is Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/smartmobilefactory/epubreader/databinding/EpubHorizontalVerticalContentBinding;

timfreiheit commented 6 years ago

@laogaoxiaoxin can you create a new issue next time. this would help keeping the overview.

Unfortunately i only tested the library with DataBinding enabled and forgot about the use case without it.

can you enabling DataBinding by adding

dataBinding {
    enabled true
}

into your build.gradle. See the sample project for details.

I need to remove this requirement in one of the next versions.

gaoyx-tech commented 6 years ago

thank for your answer,and i have write that code in my gradle file,but it does not work and still crash.and i also notice that,you lib only support mvvm,and my project is not use mvvvm.do you have another way to solve it?i very very wanna use you lib.thanks

timfreiheit commented 6 years ago

enabling DataBinding does not require you to use MVVM. This is just library internals. Can you check if the sample project works for you and check if the integration is done the same on your project?