• Install Android SDK (http://developer.android.com/sdk/index.html)
    • Install Android NDK - 
    • You need to install Cygwin latest version. download the setup.exe from http://cygwin.com/install.html and follow instructions. do not skip a single step while installing Cygwin.
    • 4. Download MuPDF source zip file and third-party zip file here http://code.google.com/p/mupdf/downloads/list
    • Extract your mupdf source folder somewhere in your hard disk (path must not contain any spaces)
    • Create a folder named ‘thirdparty’ in the mupdf source folder you have extracted. It should be in the same level of ‘android’, ‘apps’, ‘fitz’, ‘win32′ etc. and extract downloaded thirdparty zip file directly under created folder.
    • You need to have Visual studio installed. if not you can download trial version here : http://www.microsoft.com/en-us/download/details.aspx?id=12752 
    • Go to mupdf source folder, open win32 folder and double click generated.vcproj then it will open with visual studio.
    • In visual studio just run the c++ application. no need to have any visual studio or c++ knowledge. just press green arrow button (run button)
    • If everything goes ok, it should create a folder inside mupdf source. the folder name is ‘generated’ and it should contain some header files (.h files)
    • Open Cygwin console,(just double click cygwin installation short-cut) and type following command and enter.
      • cd /cygdrive/<path to mupdf sorce folder/android ex. cd /cygdrive/c/mupdf-1.0-source/android
      • /cygdrive/<path to ndk installation>/ndk-build ex. /cygdrive/c/ndk/ndk-build
    • That's all. Final step, create an Android application using mupdf android source (inside android folder). You can create this project as a library project and include it in your main project.
    This is how you need to call mu-pdf activity from your main project.


    Uri uri = Uri.parse("path to pdf file");

    Intent intent = new Intent(context, MuPDFActivity.class);

    intent.setAction(Intent.ACTION_VIEW);

    intent.setData(uri);

    context.startActivity(intent);


    Cygwin Installation Instructions



    • Choose install from internet
    • When you specify installation location be sure to choose a directory path that contains no spaces in it
    • Choose a mirror site close to you
    • After you choose the mirror and click Next, Cygwin will download and present to you the list of available packages:
    • I suggest that we install the entire Devel branch. Click (once) on the word “Default” next to the root Devel node and wait few seconds while the setup hangs. When it is back, you will see that “Default” changes to “Install” for the Devel node. Then press next.
    • This might take long, may be half an hour or may be 1 – 3 hours depends on your internet connection. let it to be installed and create a short-cut on the desktop.



    19

    View comments

Blog Archive
About Me
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.