I want to be able to access a word file in the sdcard of the user's phone, and the file will be chosen by the user. I want to be able to process the file, i.e. read its contents and modify it as the user wishes, and save it when the user clicks “save.”
Is it possible in Android? How can I make the program understand that the file is a Word file?
Note that I don't want to view the Word file. The user will select the Word file and my app should be able to make some changes to it and save it.
Right-click the underlined word, and then choose the suggestion you want, or learn more about the error and how to correct it. Or, open the Editor pane to address issues by category. On the Review tab, select Check Document.
Here is the complete way to open . doc file in Android 7.0 or less: Step-1: First of all, place your pdf file in assets folder like the following screenshot. Step-3: Now add a new java file which should extend from FileProvider Like in my case file name is LegacyCompatFileProvider and code inside of it.
Simplest way IMHO is to port Apache POI library to Android. It's possible and there proof of that
Porting POI you can embed Word editing feature into your application.
Piece of code like:
Intent intent = new Intent(Intent.ACTION_EDIT);
Uri uri = Uri.parse("file:///"+file.getAbsolutePath());
intent.setDataAndType(uri, "plain/text");
startActivity(intent);
Simply means that Word file will be edited by some other application - not yours. As far as I understand it's not exactly what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With