Set Home| Set Favorite|

WPS Office Forum

 Forgot password?
View: 9664|Reply: 4

Codes for calling Kingsoft Office to Open files(2)

[ Promote this link! ]
Post time: 2012-11-06 04:41:24
| Show all posts |!read_mode!
Edited by bonnie at 2012-11-06 04:51

From Kingsoft Office V5.1 we have provided the additional functionality. The third-party programs can call the “Kingsoft Office” to open files by the integrated manner. Also when saving or closing files, the third-party programs can receive broadcast notification. The following are instructions and precautions.

Open File
Call the “starActivity” to open:

boolean openFile(String path)
     Intent intent = new Intent();
Bundle bundle = new Bundle();
bundle.putString(OPEN_MODE, READ_ONLY);
bundle.putBoolean(SEND_CLOSE_BROAD, true);
bundle.putString(THIRD_PACKAGE, selfPackageName);
bundle.putBoolean(CLEAR_BUFFER, true);
bundle.putBoolean(CLEAR_TRACE, true);
//bundle.putBoolean(CLEAR_FILE, true);
intent.setClassName(packageName, className);
File file = new File(path);
if (file == null || !file.exists())
{ return false;
Uri uri = Uri.fromFile(file);
catch (ActivityNotFoundException e)
return false;
return true;

* className: “cn.wps.moffice.documentmanager.PreStartActivity”
* packageName: “cn.wps.moffice_eng”

The file which will be opened is sent by Uri. Other parameter descriptions are as follows:

Save File
It will send a “” broadcast when saving files, and the third-party program can receive the broadcast according to the need.

Close File
It will send a “” broadcast when closing files, and the third-party program can receive the broadcast according to the need.

Example: testThirdInterface.rar (123.89 KB, Downloads: 663)

Use magic Report

Post time: 2012-12-06 14:09:55
| Show all posts

I have tried to use the example all works fine but my application end up without read permissions on the file...

In both BroadcastReceiver I have added :

File file = new File(fileName);
        strLog += "status: can read!!";
        strLog += "status: CAN'T read!!";

and in both cases save/close my app has no access to the file so I can't save the
file to the server ...


Post time: 2014-02-14 16:52:31
| Show all posts
Post time: 2014-02-15 14:23:49
| Show all posts
Post time: 2019-05-08 14:06:58
| Show all posts
I have an in-depth knowledge on SEO for blogs, e-commerce sites. I am working as an SEO consultant for Techno-Apogee Group and audit their SEO and Digital Marketing operations. Apart from that, I love to learn about SEO. Similarly, My SEO service covers – Keyword Research, On-page SEO Optimization, Link Building and google analytics. I do not only focus on Search Engine Optimization, Even more, I try to grab the opportunity of other areas of Digital Marketing, such as Social Media Marketing, Link Building, Website speed optimization, Image optimization and so on. Likewise, I try to ensure getting benefits for using paid and free digital marketing tools to get the maximum output from SEO for my clients.

You have to log in before you can reply Login | Register

Points Rules

Dark room|Mobile|Archiver|WPS Office   

2019-06-16 17:59 GMT+8 , !processed_in! 0.068300 !seconds!, 11 !queries! .

Powered by Discuz! X3.2

Release 20151208, © 2001-2019 Comsenz Inc.

MultiLingual version, Rev. 469, © 2009-2019

!fastreply! To Top !return_list!