We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
由于我们需要显示的大多数文档已经托管在网络上,因此我们选择使用嵌入式网络视图,该视图使用 Google 文档查看器。
尽管这种方法不起作用,但我们仍然有一些本地存储的文档。对于这些,我们的解决方案是依赖现有应用程序的支持。在使用 Android 一段时间后,似乎大多数设备都配备了某种开箱即用的文档/pdf 阅读功能。如果他们没有功能强大的应用程序,我们会引导他们去市场寻找免费阅读器。
Since most of the documents we need to display are already hosted on the web, we opted to use an embedded web view that opens the document using google docs viewer.
We still have a few locally stored documents though that this approach doesn't work with. For these, our solution was to rely on the support of existing apps. After spending some more time with Android, It seems that most devices come equipped with some sort of document/pdf reading capability installed fresh out of the box. In the event that they don't have a capable app, we direct them to a market search for a free reader.
不幸的是,没有内置的 Android 控件来编辑 MS Office 文件,甚至显示它们!这是一个相当大的遗漏,因为 iOS 内置了对显示 Office 文件的支持(尽管 iOS 经常错误地显示更复杂的文档)。似乎没有足够一致的查看器应用程序可供依赖(并且它们可能无法提供您所希望的那种用户体验)。
如果您想在 Android 应用程序中显示或编辑 docx 等,则必须嵌入一些添加此功能的第三方代码。我不知道有任何预打包的开源代码可以做到这一点,因此除非您想自己构建/移植解决方案,否则您将需要获得商业许可。
正如其他人所指出的,该领域有一些开源项目,但它们没有打包/移植到 Android。如果您确实设法移植和集成它们,它们会给您的 Android 应用程序下载增加巨大的开销(例如 80+ 兆字节),然后您需要为它们添加适合移动设备的 UI(请参阅 https://play.google.com/store/apps/details? id=com.andropenoffice&hl=en_GB 是一个带有 ui 的端口示例,我个人认为它对于 Android 应用程序不适合/用户友好。)
我熟悉的一个这样的 SDK 可以解决这个问题基于 SmartOffice 应用程序:
https://artifex.com/products-smart-office-概述/
它作为安全的嵌入式库提供,支持 Office 文档的显示和(可选)编辑。您可以联系[电子邮件受保护]以获取许可信息。
披露:我的工作之一涉及编写 SmartOffice 代码。
Unfortunately there's no built in Android control to edit MS Office files, or even to display them! It's a pretty big omission given iOS has built in support for displaying Office files (albeit the iOS one often displays more complex documents incorrectly). There don't seem to be viewer app consistently enough available to rely on (and they may not provide the kind of user experience you're hoping for either).
If you want to display or edit docx etc within your android application, you have to embed some third party code that adds this functionality. I'm not aware of any pre-packaged open source code that can do this, so unless you want to build/port a solution yourself you will need to commercially license something.
As others have noted, there are some open source projects in this area, but they're not packaged/ported to Android. If you did manage to get them ported and integrated, they'd add a huge overhead to your Android app download (eg. 80+ megabytes) and you'd need to then add a mobile suitable UI for them (see https://play.google.com/store/apps/details?id=com.andropenoffice&hl=en_GB for an example of a port with ui that I personally think is not suitable/user friendly for an Android application.)
One such SDK that I'm familiar with which solves this problem is based on the SmartOffice application:
https://artifex.com/products-smart-office-overview/
It's available as an secure embeddable library that supports both display and (optionally) editing of Office documents. You can contact [email protected] for licensing information.
Disclosure: One of my jobs involves working on the SmartOffice code.
大多数 Microsoft 文档查看器都很重且昂贵。
如果您想自己创建查看器,您应该查看 Apache POI。
Most of the Microsoft Document viewers are heavy and expensive.
If you want to create a viewer yourself, you should take a look at Apache POI.
合适的解决方案可能是使用下面链接中的 Jword。它不是免费的,但易于使用。
http://www.independentsoft.de/jword/index.html
使用该库是就像这个示例代码一样简单
A suitable solution might be using Jword in the link below. It's not free but easy to use.
http://www.independentsoft.de/jword/index.html
Using the library is as simple as this sample code