Skip to content
Hrishikesh Kadam edited this page Aug 31, 2018 · 17 revisions

FolioReader logo

Welcome to the FolioReader-Android Wiki!

FolioReader-Android is an ePub reader written in Java.

Gradle

Add following dependency to your app module build.gradle file:

repositories {
    maven {
        url 'http://dl.bintray.com/mobisystech/maven'
    }
}

dependencies {
    implementation 'com.folioreader:folioreader:0.4.2'
}

AndroidManifest

Starting with Android 9.0 (API level 28), cleartext support is disabled by default.

{your-app-module}/res/xml/network_security_config.xml

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">127.0.0.1</domain>
        <domain includeSubdomains="true">localhost</domain>
    </domain-config>
</network-security-config>

Then add network_security_config.xml in your app module's AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    ...
    <application android:networkSecurityConfig="@xml/network_security_config">
    ...
    </application>
</manifest>

Usage

Get singleton object of FolioReader:

FolioReader folioReader = FolioReader.get();

Call the function openBook():

opening book from assets -
folioReader.openBook("file:///android_asset/TheSilverChair.epub");
opening book from raw -
folioReader.openBook(R.raw.adventures);

Note: From v0.4.1 you don't need to specify permissions and FolioActivity tag in AndroidManifest.xml