-
Notifications
You must be signed in to change notification settings - Fork 720
Home
Hrishikesh Kadam edited this page Sep 3, 2018
·
17 revisions
FolioReader-Android is an ePub reader written in Java.
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.3'
}
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>
Get singleton object of FolioReader
:
FolioReader folioReader = FolioReader.get();
Call the function openBook()
:
folioReader.openBook("file:///android_asset/TheSilverChair.epub");
folioReader.openBook(R.raw.adventures);
Note: From v0.4.1 you don't need to specify permissions and FolioActivity
tag in AndroidManifest.xml