问题
I am looking at many post, looking for a way to implement this example in my Android application. http://apv.googlecode.com/files/apv-0.3.3dev01.tar.gz
I read somewhere that I have to use NDK, I've downloaded, but I do not understand to do with this.
I have also read that I have running the script build-native.sh, nor is how to do it.
When you run the project when you download it, I have the following error.
07-03 10:18:06.171: ERROR/AndroidRuntime(375): FATAL EXCEPTION: main
07-03 10:18:06.171: ERROR/AndroidRuntime(375): java.lang.ExceptionInInitializerError
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at cx.hell.android.pdfview.OpenFileActivity.getPDF(OpenFileActivity.java:541)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at cx.hell.android.pdfview.OpenFileActivity.startPDF(OpenFileActivity.java:502)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at cx.hell.android.pdfview.OpenFileActivity.onCreate(OpenFileActivity.java:219)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at android.os.Handler.dispatchMessage(Handler.java:99)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at android.os.Looper.loop(Looper.java:123)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at java.lang.reflect.Method.invokeNative(Native Method)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at java.lang.reflect.Method.invoke(Method.java:521)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at dalvik.system.NativeStart.main(Native Method)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): Caused by: java.lang.UnsatisfiedLinkError: Library pdfview2 not found
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at java.lang.Runtime.loadLibrary(Runtime.java:461)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at java.lang.System.loadLibrary(System.java:557)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): at cx.hell.android.lib.pdf.PDF.<clinit>(PDF.java:25)
07-03 10:18:06.171: ERROR/AndroidRuntime(375): ... 16 more
How can I fix it?
Thanks!!
回答1:
You need to add .so files in libs folder of your project to run pdf.And these files only be made using NDK. please refer this link
You are missing pdfview2 library.
EDIT: you can buid .so files, or simply extrect lib files from the apk file. You can download apk file from
http://code.google.com/p/apv/downloads/detail?name=apv-0.3.3dev01.apk&can=2&q=
open .apk file ussing zip tool and copy the .so files in your project. :)
来源:https://stackoverflow.com/questions/11308991/implement-pdfviewer-with-apv