I am trying to add an epub file called test.epub to my SkyEPub test app. I'm not sure what method to use that will add the epub to the library.
public void libraryButtonClick() {
String targetDir = new String(SkySetting.getStorageDirectory() + "/books/test.epub");
showToast("targetDir "+targetDir);
//ls.startDownload(targetDir,"","","");
}
UPDATE I tried using this solution android epub library, skyepub
With a few modifications
public void unzipBook2(String fileName) {
String targetDir = new String(getFilesDir().getAbsolutePath() + "/books/" + fileName);
targetDir = SkyUtility.removeExtention(targetDir);
String filePath = new String(getFilesDir().getAbsolutePath() + "/books");
Unzip unzip = new Unzip(fileName, filePath, targetDir);
unzip.addObserver(new UnzipHandler2());
unzip.unzip();
}
class UnzipHandler2 implements Observer {
@Override
public void update(Observable observable, Object data) {
//Unzip completed
(new Handler()).postDelayed(new Runnable() {
public void run() {
}
},500);
}
}
but I end up getting these errors
01-19 21:14:00.650: D/UnZip(2370): unzipping test.zip to /data/data/com.skytree.epubtest/files/books/test
01-19 21:14:00.653: E/UnZip(2370): Error while extracting file /data/data/com.skytree.epubtest/files/books/test.zip
01-19 21:14:00.653: E/UnZip(2370): java.io.FileNotFoundException: /data/data/com.skytree.epubtest/files/books/test.zip: open failed: ENOENT (No such file or directory)
01-19 21:14:00.653: E/UnZip(2370): at libcore.io.IoBridge.open(IoBridge.java:456)
The problem is the tutorial provided by SkyEpub references a Java method
private void installSamples()
There seems to have been a major code revision at v3.8.0. Older version of the android sample have this installSamples
method and should provide a good reference for how to install epubs using this SDK.
Older versions can be downloaded from a Dropbox account. There is a link to "SkyEpub Old Releases" http://skyepub.net/downloads/