随笔 - 124  文章 - 0  评论 - 93  阅读 - 18万
10 2011 档案
Google Docs Viewer使用笔记
摘要:通常情况下这样使用:http://docs.google.com/viewer?url=http://abc/test.pdf&embedded=true这样相当于把我们的文件直接暴露给外部了,这样就没办法处理文件权限等问题,我们希望这个test.pdf是由一个servlet来处理,在servlet里面我们可以做文件权限的处理,如果没有权限,就不让用户浏览文件,如果有权限才返回文件流信息。测试时发现response里面要设置一些header信息,不然google docs viewer没法解析文件。DocServlet.java 1publicvoiddoGet(HttpServlet 阅读全文
posted @ 2011-10-18 12:51 TroyZ 阅读(2125) 评论(0) 推荐(0) 编辑
关于在线浏览office/pdf文件
摘要:最好的方法当然是针对每种类型文件解析,然后呈现,但是这个代价好高的,这里提供几种方式1. 使用Google Documents List API, 要求:有 google 帐号,文档需存放在 google docs 端, google documents list api 提供了一系列针对文档管理的API,包括上传,下载,修改,格式转换,,, 有时候我们希望将office/pdf转成html, google docs api 可以将 office 转成html(包括图片等,office2003,2007测试没问题), 但是不能把PDF转成html 参考文档: 定义 import/... 阅读全文
posted @ 2011-10-14 12:35 TroyZ 阅读(2275) 评论(0) 推荐(0) 编辑
service 2种生命周期
摘要:1. startService() 启动service (跨Activity存在) onCreate --> onStart() --> (重复调用startService()时) --> onStart() stopService() 停止service onDestroy()2. bindService() 启动service (依附于当前Activity) onCreate() --> onBind() unBindService() 或者 Activity 退出时 onDestroy()通常的做法是,结合IBinder, 用startService来启动一个Se 阅读全文
posted @ 2011-10-12 15:12 TroyZ 阅读(255) 评论(0) 推荐(0) 编辑
android share file (via bluetooth, email,,,,)
摘要:1Intentintent=newIntent(Intent.ACTION_SEND);2intent.setType("*/*");3//intent.setType("image/png");4intent.putExtra(Intent.EXTRA_STREAM,Uri.fromFile(newFile("/sdcard/test.docx")));5startActivity(Intent.createChooser(intent,"ShareFile"));蓝牙,gmail, email等支持的MIMI 阅读全文
posted @ 2011-10-11 15:50 TroyZ 阅读(399) 评论(0) 推荐(0) 编辑


点击右上角即可分享
微信分享提示