0

We have an Android application that we have developed and are testing with ARC. Part of the functionality is to share Word/PDF and other documents with other applications on an Android device and then have them pass the content back to us when done. However, since ARC applications run in their own sandbox instance of Android there are no other applications to share with using the standard intents. I know that Chrome Extensions can message each other, but is there a way to access this functionality from an Android APP running arc. Ideally we'd like to share a document have it open in say Google Drive, and then be able to get it back from there using the standard Android intents. Is this possible, or do we have to look at other ways to accomplish this (i.e. SDKs.)

Update: Here is the code we use to launch external activities to have them open files for editing:

    Uri uri = Uri.fromFile(attachmentFile);
    Intent intentUrl = new Intent(Intent.ACTION_VIEW);
    intentUrl.setDataAndType(uri, applicationType);
    intentUrl.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    getContext().startActivity(externalActivityIntent);
kingargyle
  • 1,239
  • 10
  • 15
  • "Part of the functionality is to share Word/PDF and other documents with other applications on an Android device and then have them pass the content back to us when done" -- how are you accomplishing this today in ordinary Android? `ACTION_SEND`? Something else? – CommonsWare Apr 09 '15 at 20:37
  • Using a share intent, and specifying the MimeType for the content. – kingargyle Apr 13 '15 at 19:45
  • How are you then doing "have them pass the content back to us when done"? `ACTION_SEND` is a one-way street. – CommonsWare Apr 13 '15 at 19:49
  • In many cases we either check for a resultCode when the Activity is being returned, or we check if the file was updated since the last time we shared it and the read the file back in. – kingargyle Apr 13 '15 at 19:53
  • "we either check for a resultCode when the Activity is being returned" -- `ACTION_SEND` is not designed for use with `startActivityForResult()`, and so there is no reliable result code. "we check if the file was updated" -- you will not have access to that in ARC AFAIK. – CommonsWare Apr 13 '15 at 20:07
  • I've updated the question with the exact code we are using to launch the external activities. Basically we need to be able to have items open in an appropriate viewer or editor. – kingargyle Apr 14 '15 at 12:56

1 Answers1

0

You can get the file from Google Drive or any other file provider available on the chromeOS using the new intent: ACTION_OPEN_DOCUMENT

Felipe
  • 58
  • 3