우리 응용 프로그램을 통해 화면에 epub 파일을 표시하고 있습니다. 파일은 SDCard에 저장되고 SDCard에서 파일 데이터를 가져 와서 Screen에 표시 할 때 사용하는 다음 논리가 사용됩니다. 그러나 화면에 내용을로드하는 데 오랜 시간이 걸립니다. 내 코드에 문제가 있습니까? 친구 좀 도와주세요.장치에 epub 파일을 표시하는 데 오랜 시간이 걸렸습니다.
File rootDir = Environment.getExternalStorageDirectory();
EpubReader epubReader = new EpubReader();
try {
book = epubReader.readEpub(new FileInputStream("/sdcard/forbook.epub"));
Toast.makeText(getApplicationContext(), "Book : " + book, Toast.LENGTH_LONG).show();
} catch (FileNotFoundException e) {
Toast.makeText(getApplicationContext(), "File Not Found" + book, Toast.LENGTH_LONG).show();
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
Toast.makeText(getApplicationContext(), "IO Found" + book, Toast.LENGTH_LONG).show();
e.printStackTrace();
}
Spine spine = book.getSpine();
List<SpineReference> spineList = spine.getSpineReferences() ;
int count = spineList.size();
StringBuilder string = new StringBuilder();
String linez = null;
for (int i = 0; count > i; i++) {
Resource res = spine.getResource(i);
try {
InputStream is = res.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
try {
String line;
while ((line = reader.readLine()) != null) {
linez = string.append(line + "\n").toString();
//linez=line.toString();
}
} catch (IOException e) {e.printStackTrace();}
//do something with stream
} catch (IOException e) {
e.printStackTrace();
}
}
final String mimeType = "text/html";
final String encoding = "UTF-8";
webView.loadDataWithBaseURL("", linez, mimeType, encoding,null);
}
제발 나를 도와주세요.
누구든지 샘플 epub 리더에 대한 링크를 제공 할 수 있습니까? –
내 자신의 프로젝트를 다시 광고 할 위험이 있습니다. http://github.com/nightwhistler/pageturner - GPL 라이센스가 있음을인지하십시오. – NightWhistler