In android Java - the development language for creating APP, use Epublib (lib in java)
" doc" poi
epub:
package nl.siegmann.epublib.examples;
import java.io.InputStream;
import java.io.FileOutputStream;
import nl.siegmann.epublib.domain.Author;
import nl.siegmann.epublib.domain.Book;
import nl.siegmann.epublib.domain.Metadata;
import nl.siegmann.epublib.domain.Resource;
import nl.siegmann.epublib.domain.TOCReference;
import nl.siegmann.epublib.epub.EpubWriter;
public class Translator {
private static InputStream getResource( String path ) {
return Translator.class.getResourceAsStream( path );
}
private static Resource getResource( String path, String href ) {
return new Resource( getResource( path ), href );
}
public static void main(String[] args) {
try {
Book book = new Book();
Metadata metadata = book.getMetadata();
metadata.addTitle("Epublib test book 1");
metadata.addAuthor(new Author("Joe", "Tester"));
book.setCoverImage(
getResource("/book1/test_cover.png", "cover.png") );
book.addSection("Introduction",
getResource("/book1/chapter1.html", "chapter1.html") );
book.getResources().add(
getResource("/book1/book1.css", "book1.css") );
TOCReference chapter2 = book.addSection( "Second Chapter",
getResource("/book1/chapter2.html", "chapter2.html") );
book.getResources().add(
getResource("/book1/flowers_320x240.jpg", "flowers.jpg"));
book.addSection(chapter2, "Chapter 2, section 1",
getResource("/book1/chapter2_1.html", "chapter2_1.html"));
book.addSection("Conclusion",
getResource("/book1/chapter3.html", "chapter3.html"));
EpubWriter epubWriter = new EpubWriter();
epubWriter.write(book, new FileOutputStream("test1_book1.epub"));
} catch (Exception e) {
e.printStackTrace();
}
}
}