简体   繁体   中英

How to create an MS Word document within an Android app

I want to create a word document within an android app and send that document through mail. Is there any tutorial for creating a word document in android. I have gone through several other questions on this website but i didn't got a clear answer. can we do this on Android using Apache POI. If any any sample example exist then please mention. Thanks in advance.

You can use any Java library in Android, so I do think this would be the way you could accomplish what you want (using Apache POI).

You can send the attachment by adding it as an extra to the Intent you use to create a mail message (lots of examples of that).

Apache POI looks your best bet, but note that the component that deals with Word docs only supports simple files:

HWPF and XWPF for Word Documents

HWPF is our port of the Microsoft Word 97 (-2003) file format to pure Java. It supports read, and limited write capabilities. It also provides simple text extraction support for the older Word 6 and Word 95 formats. Please see the HWPF project page for more information. This component remains in early stages of development. It can already read and write simple files .

We are also working on the XWPF for the WordprocessingML (2007+) format from the OOXML specification. This provides read and write support for simpler files , along with text extraction capabilities.

You should seriously consider whether you can use a different format for your emails - plain text, or maybe HTML.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM