To build/debug android build.
1) Download the android sdk, and install it. These instructions have been
written with r14 (the latest version at time of writing) of the SDK in mind;
other versions may give problems. On windows r14 unpacked as:
C:\Program Files (x86)\Android\android-sdk
on Macos an older version installed as:
/Library/android-sdk-mac_x86
Whatever directory it unpacks to, ensure that both the 'tools' and
'platform-tools' directories inside it have been added to your PATH.
2) Download the android ndk, and unpack it. These instructions have been
written with r6b (the latest version at the time of writing) of the NDK
in mind; other versions may give problems. On windows I unpacked it as:
C:\android-ndk-r6b
on Macos an older version unpacked as:
/Library/android-ndk-r5
It is very important that you should unpack it to a directory with no
spaces in the name! (Don't be tempted to put it in C:\Program Files etc)
Ensure that that directory is also added to your PATH.
3) On windows, to use the ndk, you *must* be running under cygwin. This means
you need to install Cygwin 1.7 or greater now.
[ In version r5 of the ndk, when running under cygwin, there were ]
[ bugs to do with the automatic conversion of dependencies from DOS ]
[ format paths to cygwin format paths. The 2 fixes can be found in: ]
[ ]
[ <http://groups.google.com/group/android-ndk/msg/b385e47e1484c2d4> ]
[ ]
[ Use the latest version and there should not be a problem. ]
4) If the SDK has not popped up a window already, bring up a shell, and run
'android' (or android.bat on cygwin/windows). You should now have a window
with a graphical gui for the sdk. From here you can install the different SDK
components for the different flavours of android. Download them all -
bandwidth and disk space are cheap, right?
5) In new versions of the GUI there is a 'Tools' menu from which you can
select 'Manage AVDs...'. In old versions, go to the Virtual Devices entry
on the right hand side. You need to create yourself an emulator image to
use. Click 'New...' on the right hand side and a window will appear. Fill
in the entries as follows:
Name: FroyoEm
Target: Android 2.2 - API Level 8
CPU/ABI: ARM (armeabi) (If this option exists)
SD card: Size: 1024MiB
Skin: Resolution: 480x756 (756 just fits my macbook screen, but 800 may
be 'more standard')
Click 'Create AVD' (on old versions you may have to wait for a minute or
so while it is prepared. Now you can exit the GUI.
6) You will need a copy of the JDK installed. See
<http://www.oracle.com/technetwork/java/javase/downloads/>. When this
installs, ensure that JAVA_HOME is set to point to the installation
directory.
7) You will need a copy of Apache ANT installed.
See <http://ant.apache.org/>. Ensure that ANT_HOME is set to point to
the top level directory, and that ANT_HOME/bin is on the PATH.
8) Now we are ready to build mupdf for Android. Check out a copy of MuPDF
(but you've done that already, cos you're reading this, right?).
9) You will also need a copy of mupdf-thirdparty.zip (see the source code
link on http://mupdf.com/). Unpack the contents of this into a 'thirdparty'
directory created within the mupdf directory (i.e. at the same level as
fitz, pdf, android etc).
10) Finally, you will need a copy of a 'generated' directory. This is not
currently available to download.
The normal mupdf build process involves running some code on the host
(the machine on which you are compiling), rather than the target (the
machine/device on which you eventually want to run mupdf). This code
repacks various bits of information (fonts, CMAPs etc) into a more
compact and usable form.
Unfortunately, the android SDK does not provide a compiler for the host
machine, so we cannot run this step automatically as part of the android
build. You will need to generate it by running a different build, such
as the windows or linux native builds.
We do not make a snapshot of the generated directory available to
download as the contents of this directory change frequently, and we'd
have to keep multiple versions on the website. We assume that anyone
capable of building for android is capable of doing a normal hosted
build.
On windows (where you are using cygwin), or on linux/macos, this can be
as simple as running 'make' in the top level directory. Even if the
make process fails, it should get far enough to generate you the required
'generated' directory, and you can continue through these instructions.
11) Change into the android directory, and edit local.properties into your
favourite editor. Change the sdk path there as appropriate. This should be
the only bit of localisation you need to do.
12) Change into the android directory (note, the android directory, NOT
the android/jni directory!), and execute (in a Cygwin window on Windows!):
ndk-build
This should build the native code portion.
If this dies with an error in thirdparty/jbig2/os_types.h load this
file into an editor, and change line 43 from:
#else
to
#elif !defined(HAVE_STDINT_H)
and this should solve the problem.
13) Then execute:
ant debug
or on windows under cygwin:
ant.bat debug
This should build the java wrapper.
14) Now start the emulator by executing:
emulator -avd FroyoEm
This will take a while to full start up (be patient).
15) We now need to give the demo file something to chew on, so let's copy
a file into the SD card image of the emulator (this should only need to be
done once). With the emulator running type:
adb push ../../MyTests/pdf_reference17.pdf /mnt/sdcard/Download/test.pdf
(where obviously ../../MyTests/pdf_reference17.pdf is altered for your
machine, and under Windows, should start c:/ even if invoked from cygwin) (adb lives
in <sdk>/platform-tools if it's not on your path).
16) With the emulator running (see step 14), execute
ant debug install
('ant.bat debug install' on Windows) and that will copy MuPDF into the
emulator where you can run it from the launchpad screen.
17) To see debug messages from the emulator (including stdout/stderr from
our app), execute:
adb logcat
Good luck!
没有合适的资源?快使用搜索试试~ 我知道了~
MuPdf实现预览pdf文件
共116个文件
png:40个
class:29个
xml:14个
4星 · 超过85%的资源 需积分: 49 221 下载量 133 浏览量
2015-12-20
21:51:38
上传
评论 2
收藏 12.53MB RAR 举报
温馨提示
MuPdf实现Android应用内部预览pdf文件;将其作为依赖库,在Android项目内部嵌入MuPdf实现应用内部预览pdf文件,不用再调用外部浏览器了。无缝结合,亲测。
资源推荐
资源详情
资源评论
收起资源包目录
MuPdf实现预览pdf文件 (116个子文件)
resources.ap_ 52KB
MyMuPDF.apk 6.91MB
mupdf.c 15KB
MyMuPDFPageView.class 8KB
MainActivity.class 5KB
MuPDFActivity.class 5KB
StephenPicScaleView.class 5KB
MuPDFCore.class 3KB
MyMuPDFPageView$1.class 3KB
TestMuPDFActivity.class 2KB
MyMuPDFPageAdapter.class 2KB
TestMuPDFActivity$1.class 2KB
MyMuPDFPageView$2.class 2KB
MyMuPDFPageAdapter$1.class 2KB
MainActivity$2.class 2KB
MainActivity$2$1.class 1KB
MainActivity$loadDataThreah.class 986B
MainActivity$1.class 979B
MuPDFActivity$1.class 884B
R$string.class 874B
R$drawable.class 841B
BaseActivity$myHandler.class 700B
BaseActivity.class 647B
PatchInfo.class 637B
R.class 618B
R$id.class 592B
OpaqueImageView.class 467B
R$layout.class 457B
R$color.class 417B
R$style.class 410B
BuildConfig.class 343B
R$attr.class 337B
.classpath 475B
classes.dex 30KB
gdbserver 122KB
gdbserver 122KB
MyMuPDFPageView.java 7KB
StephenPicScaleView.java 6KB
MainActivity.java 4KB
MuPDFActivity.java 3KB
R.java 3KB
MuPDFCore.java 3KB
TestMuPDFActivity.java 2KB
MyMuPDFPageAdapter.java 2KB
BaseActivity.java 424B
BuildConfig.java 159B
ThirdParty.mk 7KB
Core.mk 3KB
Android.mk 460B
Application.mk 163B
darkdenim3.png 25KB
darkdenim3.png 22KB
icon.png 5KB
icon.png 5KB
icon.png 3KB
icon.png 3KB
ic_list.png 3KB
ic_list.png 3KB
icon.png 2KB
icon.png 2KB
ic_nolink.png 743B
ic_nolink.png 690B
ic_hl_link.png 601B
ic_hl_link.png 558B
ic_nolink.png 518B
ic_nolink.png 489B
ic_hl_link.png 442B
ic_hl_link.png 405B
ic_magnifying_glass.png 386B
ic_link.png 374B
ic_magnifying_glass.png 344B
ic_link.png 342B
ic_link.png 330B
ic_magnifying_glass.png 323B
ic_link.png 310B
ic_magnifying_glass.png 298B
ic_cancel.png 248B
ic_arrow_right.png 233B
ic_cancel.png 230B
ic_arrow_left.png 225B
ic_arrow_right.png 216B
ic_cancel.png 212B
ic_arrow_left.png 212B
ic_arrow_right.png 208B
ic_arrow_left.png 206B
ic_arrow_right.png 204B
ic_arrow_left.png 204B
ic_cancel.png 199B
ic_list.png 130B
ic_list.png 125B
org.eclipse.jdt.core.prefs 177B
.project 871B
default.properties 479B
project.properties 361B
local.properties 92B
gdb.setup 378B
gdb.setup 374B
build.sh 29B
libmupdf.so 6.53MB
libmupdf.so 6.51MB
共 116 条
- 1
- 2
花燃柳卧
- 粉丝: 33
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页