Getting Started with EPUB SDK

See in google document: Get Started With EPUB SDK

Getting Started with EPUB SDK

Introduction

EPUB SDK is a development kit written in pure ANSI C, realizing EPUB 3.0 parsing and achieving excellent performance on mobile devices.
This development kit provides native development interfaces for both Android and iOS. It contains a framework for the iOS platform, a jar file and a shared library for the Android platform.
All you need to do is simple copying and importing, then you can directly reference in your own project.

Installation
The EPUB SDK is distributed as a .zip archive. The file name has the following naming convention: AnFengde-EPUB_SDK-<version>.zip, where

  • <version> is the versiom number, e.g. 20120704
  • for example: AnFengde-EPUB_SDK-20120704.zip

The distribution
After you have downloaded and extracted the archive to the desired location, you will find the following contents:

  • android    directory containing the EPUB SDK resources for the Android platform
    • EPUB_SDK_Example    directory containing the EPub SDK example for android
    • UI_Example    directory containing the UI component project for android
    • lib    directory containing the EPUB_UI library project
  • ios        directory containing the EPUB_SDK resources for the iOS platform
    • EPUB_SDK_Example    directory containing the EPub SDK example for iOS
    • UI_Example    directory containing the UI component project for iOS
    • lib     directory containing the framework AnFengDe_EPUB_SDK.framework and AnFengDe_EPUB_UI.embeddedframework
  • README.md
  • GettingStartedwithEPUBSDK.pdf
  • GettingStartedWithEPUBUIComponent.pdf

Setting Up Development Environment
For the Android platform, this guide assumes that you are using Eclipse as your Android IDE, and that you have installed and configured the Android SDK and ADT plug-in for Eclipse.
For iOS platform, this guide assumes that you are using Xcode as your IDE.
If you are using other IDEs, please consult the documentation of your IDE.

Using EPUB SDK in Your Application Project
Android Platform
In order to use our EPUB SDK in your application project, your project will need to reference both the jar file (anfengde-epub.jar ) and the shared library (libepubjni.so). You can copy the files under android/lib/EPUB_UI/libs (containing anfengde-epub.jar and armeabi/libepubjni.so) to your own project. Please put these files under project/libs folder. If no libs folder exists in your own project, you can create one manually.
Referencing the EPUB SDK implementation jar library
To add a reference to the jar library, follow these steps:

  • Method One
    • In Package Explorer, right-click on libs/anfengde-epub.jar and select Build Path->Add to Build Path.
  • Method Two
    • In Package Explorer, right-click on your project and select Properties.
    • In the Properties window, select Java Build Path, and then click on Libraries tab, then click on the Add External Jar button, and browse your jar file and click OK (Java Build Path->Libraries->Add External Jar->pick the jar file->OK).

Figure 1 – android EPUB SDK add jar-method one

Figure 2 – android EPUB SDK add jar-method two

After the above operations, you have succeeded in adding EPUB SDK to your own project, and your can use it for development.

iOS Platform
In order to use our EPUB SDK in your application project, your project will need to reference the framework of AnfengdeEpub.framework. All you need to do is to copy the framework ro your own iOS project and add it to the project.
Referencing the EPUB SDK framework
To add a reference to the framework, follow these steps:

  • In Project navigator, right-click Framework, then select Add File to “<projec name>”, and browse the framework and Add it. Then you will see as follow:

Figure 3 – Framework

Using The Sample Project
The EPUB SDK distribution package includes the sample projects to show you how you can use some of the main features of the EPUB SDK in your application.
Android platform
To open and build the sample project, follow these steps:

  • File->New->project->Android->Android Project->Next.
  • Select Creating project from existing source, and browse the sample project. And modify Project Name = Example, then click Next. Check Build Target = Android 2.2, and Next. Modify Application Name =  Example, then Finish.

Figure 4 – import the sample project

Figure 5 – load the sample project

Figure 6 – import the sample project-2

After you have setup the sample project correctly, you can then build and run the application to see the sample work.

Figure 7 – running the sample project (left is Android, right is iOS)

iOS
For the iOS sample project, you can double-click example.xcodeproj. Then you can build and run the application to see the sample work.

Leave a Reply

Your email address will not be published. Required fields are marked *