How to open pdf file which is located at server side by specifying its server side path in android using mupdf -
i using mupdf library render pdf file within android application. when specifying local path pdf, open within app, when write following code render server side pdf file, gives error message in dialog box can not open pdf file
uri uri = uri.parse("http://kmmc.in/wp-content/uploads/2014/01/lesson2.pdf"); intent intent = new intent(context, mupdfactivity.class); intent.setaction(intent.action_view); intent.setdata(uri); context.startactivity(intent);
i new in android application development.
here logcat:
06-03 10:57:53.517 1645-1645/com.tekinarslan.sample i/art﹕ not late-enabling -xcheck:jni (already on) 06-03 10:57:56.676 1645-1665/com.tekinarslan.sample d/openglrenderer﹕ use egl_swap_behavior_preserved: true 06-03 10:57:56.717 1645-1645/com.tekinarslan.sample d/﹕ hostconnection::get() new host connection established 0xb4a93ec0, tid 1645 06-03 10:57:56.873 1645-1645/com.tekinarslan.sample d/atlas﹕ validating map... 06-03 10:57:57.380 1645-1645/com.tekinarslan.sample i/system.out﹕ trying open /wp-content/uploads/2014/01/lesson2.pdf 06-03 10:57:57.419 1645-1645/com.tekinarslan.sample w/linker﹕ libmupdf.so has text relocations. wasting memory , prevents security hardening. please fix. 06-03 10:57:57.503 1645-1645/com.tekinarslan.sample e/libmupdf﹕ opening document... 06-03 10:57:57.504 1645-1645/com.tekinarslan.sample e/libmupdf﹕ error: cannot open /wp-content/uploads/2014/01/lesson2.pdf 06-03 10:57:57.504 1645-1645/com.tekinarslan.sample e/libmupdf﹕ error: cannot load document '/wp-content/uploads/2014/01/lesson2.pdf' 06-03 10:57:57.505 1645-1645/com.tekinarslan.sample e/libmupdf﹕ error: cannot open document: '/wp-content/uploads/2014/01/lesson2.pdf' 06-03 10:57:57.505 1645-1645/com.tekinarslan.sample e/libmupdf﹕ failed: cannot open document: '/wp-content/uploads/2014/01/lesson2.pdf' 06-03 10:57:57.508 1645-1645/com.tekinarslan.sample i/system.out﹕ java.lang.exception: cannot open file: /wp-content/uploads/2014/01/lesson2.pdf 06-03 10:57:57.853 1645-1657/com.tekinarslan.sample i/art﹕ background sticky concurrent mark sweep gc freed 2315(157kb) allocspace objects, 0(0b) los objects, 20% free, 887kb/1117kb, paused 997us total 139.942ms 06-03 10:57:58.297 1645-1657/com.tekinarslan.sample i/art﹕ background partial concurrent mark sweep gc freed 358(28kb) allocspace objects, 1(81kb) los objects, 50% free, 985kb/2009kb, paused 14.274ms total 208.324ms 06-03 10:57:58.482 1645-1645/com.tekinarslan.sample i/choreographer﹕ skipped 41 frames! application may doing work on main thread. 06-03 10:57:58.601 1645-1665/com.tekinarslan.sample d/﹕ hostconnection::get() new host connection established 0xb4b36ff0, tid 1665 06-03 10:57:58.613 1645-1665/com.tekinarslan.sample i/openglrenderer﹕ initialized egl, version 1.4 06-03 10:57:58.640 1645-1665/com.tekinarslan.sample d/openglrenderer﹕ enabling debug mode 0 06-03 10:57:58.655 1645-1665/com.tekinarslan.sample w/egl_emulation﹕ eglsurfaceattrib not implemented 06-03 10:57:58.655 1645-1665/com.tekinarslan.sample w/openglrenderer﹕ failed set egl_swap_behavior on surface 0xb4b5a240, error=egl_success 06-03 10:57:58.795 1645-1665/com.tekinarslan.sample w/egl_emulation﹕ eglsurfaceattrib not implemented 06-03 10:57:58.795 1645-1665/com.tekinarslan.sample w/openglrenderer﹕ failed set egl_swap_behavior on surface 0xb4b5a260, error=egl_success 06-03 10:57:59.114 1645-1645/com.tekinarslan.sample i/choreographer﹕ skipped 37 frames! application may doing work on main thread.
the android demo app, unlike thw windows demo app, has no built-in http client. cannot provide url.
if want have implement http communication yourself. believe windows application uses curl library, have no idea if available android.
Comments
Post a Comment