android - How to read EPUB book using EPUBLIB? -
i found solution reading epub books in android using epublib. able read subtitles of book. didn't find way read line line of content. how can acheive this?
sample code getting titles of book is
private void logtableofcontents(list<tocreference> tocreferences, int depth) { if (tocreferences == null) { return; } (tocreference tocreference : tocreferences) { stringbuilder tocstring = new stringbuilder(); stringbuilder tochref=new stringbuilder(); (int = 0; < depth; i++) { tocstring.append("\t"); tochref.append("\t"); } tocstring.append(tocreference.gettitle()); tochref.append(tocreference.getcompletehref()); log.e("sub titles", tocstring.tostring()); log.e("complete href",tochref.tostring()); //logtableofcontents(tocreference.getchildren(), depth + 1); } }
got code http://www.siegmann.nl/epublib/android
how can story of book...
i'm not sure is way navigate in epub file. far know (till - i'm still learning), better way book cocntent based on spine section. still - don't know how connect 2 things (toc , real spine) epublib interface. according documentation: "the spine sections sections of book in order in book should read. contrasts table of contents sections index book's sections."
that - if likie - snippet:
spine spine = new spine(book.gettableofcontents()); (spinereference booksection : spine.getspinereferences()) { resource res = booksection.getresource(); try { inputstream = res.getinputstream(); //do stream } catch (ioexception e) {
Comments
Post a Comment