2011-09-28 14 views
1

今、私は電子ブックリーダーで作業しています.iはこのhttp://www.siegmann.nl/epublib/androidからepubライブラリを手に入れましたが、行ごとに内容を読み込むのに長い時間がかかり、プロジェクトではコンテンツを強調するオプションがあります。可能であれば、事前に感謝しています。Androidでepubファイルを読むには?

+0

あなたの問題は何ですか? –

+0

私はepub教科書をtextview.isで表示したいですか?fはいどのように適切な答えが高く評価されましたか – daffodils

+0

@ daffodils私はそのサイトからダウンロードしましたが、それが機能していません。 – PankajAndroid

答えて

1

私はその答えをどのように考え出したのか分かりませんでした。

現在の質問では、スパインインデックス(目次とは異なり、背骨は目次とは異なります)または目次(情報がメタデータにある場合)を見ることができます。

今、あなたは背骨のインデックスのためにそれを行う方法:

Spine spine = new Spine(book.getTableOfContents()); 
List<SpineReference> spineList = spine.getSpineReferences(); //List of spine information 
Resource res = spine.getResource(1);//1 is an example to proper utilize this you have to store the information on which part you are in and how much you rendered. I suggest keeping a static integer on what your location is and after this part is done you can go to the next one and so on. 
InputStream is = res.getInputStream();//getting the inputstream 
StringBuilder string = new StringBuilder();//Create a builder as we will add more information to the string 
BufferedReader reader = new BufferedReader(new InputStreamReader(is)); 
string html,line = null; 
while ((line = reader.readLine()) != null) {//start reading the information line by line 
html = string.append(line + "\n").toString();//get information for line by line basis 
} 

今、あなたはそれが起こっている内容のテーブルのために正しい情報今

を取得するには、テキストからHTML情報を解析する必要があります。変更

ArrayList<TOCReference> book_list = new ArrayList<TOCReference>(amBook().getTableOfContents().getTocReferences()); 

それを読むために同じ方法の1行を除いてトップと同じにします。 BufferReader - > Inputstream

+0

-1、私は彼がhtmlでreadinringではなく、epubファイルを読むことを求めていると思います。 –

+0

うーん....あなたの権利私は私の答えを変更します。 – wesdfgfgd

+0

完了私は変更を加えました。 – wesdfgfgd