Android EPUBLIB read/load content

前端 未结 2 1626
北海茫月
北海茫月 2020-12-28 22:39

I\'m playing with http://www.siegmann.nl/epublib on Android. Can someone please explain the right way to

  • read epub HTML content,
  • how to show this on
2条回答
  •  甜味超标
    2020-12-28 22:51

    Answers #2:

    1. Extract epub on file system /mnt/sdcard/epub/
    2. Loading values in webview
    protected void onCreate(Bundle savedInstanceState) { 
        setContentView(R.layout.epub_reader);
        webView = (WebView) findViewById(R.id.webview);
        Book book = (new EpubReader()).readEpub(new FileInputStream(filename);
        String baseUrl="file://mnt/sdcard/epub/OEBPS/"
        String data = new String(book.getContents().get(2).getData());
        webView.loadDataWithBaseURL(baseUrl, data, "text/html", "UTF-8", null);
    }
    

提交回复
热议问题