1
HTTP 서버에 epub 파일이 있습니다. 예 : 저자 이름, 책 제목 등을 읽으려고하면 전체 EPUB 파일을 읽습니다. 나는 전체 파일을 읽는 페이지 instent에 의해 페이지를 읽고 싶다. NB : here Android epublib 참조.Android에서 epub 파일을 동시에 읽음
@Override
protected String doInBackground(String... params) {
try {
url = new URL(bookPath);
// create the new connection
urlConnection = (HttpURLConnection) url.openConnection();
// set up some things on the connection
urlConnection.setRequestMethod("GET");
urlConnection.setDoOutput(true);
// and connect!
urlConnection.connect();
// this will be used in reading the data from the internet
inputStream = urlConnection.getInputStream();
// Load Book from inputStream
book = (new EpubReader()).readEpub(inputStream);
maxLocation = book.getTableOfContents().size();
// get the book's title
String bookName = book.getTitle();
String authorName = book.getMetadata().getAuthors().toString();
Log.i("Books", "Title: " + bookName + " Author: " + authorName);
title = "Title: " + bookName + " Author: " + authorName;
int i = 1;
for (TOCReference index : book.getTableOfContents()
.getTocReferences()) {
stringBuffer.append(index.getTitle() + "</br>");
i++;
}
} catch (Exception e) {
e.printStackTrace();
}
return "Executed";
}
코드에'EpubReader' 란 무엇입니까? 어떤 도서관에서 왔습니까? BTW, EPUB 파일은 여러 파일의 (ZIP) 컨테이너입니다. 메타 데이터를 검사하기 전에 다운로드해야합니다. 또한 EPUB에는 "페이지"라는 개념이 없습니다. 질문을 명확히하십시오. –
[here] (http://www.siegmann.nl/epublib/android) 안드로이드 epublib 참조. –
질문을 명확히 할 수 없는지 질문하십시오. –