Search code examples
google-chrome-arc

Sharing Files with other Chrome Extensions using ARC


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);

Solution

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