Skip to content
Hrishikesh Kadam edited this page Jun 29, 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 build.gradle:

compile 'com.folioreader:folioreader:0.4.0'

Add maven repository to your top level build.gradle:

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

Usage

First add permissions and activity tag for FolioActivity in your AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.folioreader.android.sample">
        
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    
    <application>
    
        ...
        
        <activity
            android:name="com.folioreader.ui.folio.activity.FolioActivity"
            android:theme="@style/AppTheme.NoActionBar" />
            
        ...
        
    </application>
    
</manifest>

Note: In case if you are upgrading to 0.4.0 and above don't forget to remove android:configChanges="orientation|screenSize" from <activity> tag of FolioActivity.

Get singleton object of FolioReader:

FolioReader folioReader = FolioReader.getInstance(getApplicationContext());

Call the function openBook():

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