Skip to content
Hrishikesh Kadam edited this page Oct 11, 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 root project build.gradle file:

allprojects {
    repositories {
        ...
        maven { url "https://dl.bintray.com/mobisystech/maven" }
        maven { url "https://jitpack.io" }
        ...
    }
}

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

dependencies {
    ...
    implementation "com.folioreader:folioreader:0.5.1"
    ...
}

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


Clone this wiki locally