Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please support the open folder intent #87

Closed
contrapunctus-1 opened this issue Sep 5, 2017 · 12 comments
Closed

Please support the open folder intent #87

contrapunctus-1 opened this issue Sep 5, 2017 · 12 comments

Comments

@contrapunctus-1
Copy link

Applications like Syncthing require it to open folders.
See also syncthing/syncthing-android#838

@veniosg
Copy link
Contributor

veniosg commented Sep 6, 2017

There is no such standard Intent as far as I am aware, would you mind elaborating on the options?

@friedger
Copy link
Member

friedger commented Sep 6, 2017 via email

@veniosg
Copy link
Contributor

veniosg commented Sep 6, 2017

If I'm not mistaken this request is for pointing the file manager to launch on an arbitrary path, but without offering any further action like "pick" - at least according to the linked issue :)

@friedger
Copy link
Member

friedger commented Sep 6, 2017 via email

@k3b
Copy link
Contributor

k3b commented Oct 7, 2017

goal:

  • Intent to open filemanager and view content of a specified directory in the filemanager.
  • This feature should not be a picker

my proposal: use this: https://stackoverflow.com/questions/17165972/android-how-to-open-a-specific-folder-via-intent-and-show-its-content-in-a-file
it already works with "EF File Explorer"

  • action=android.intent.action.VIEW
  • data=file:///path/to/directory/
  • mime=resource/folder

@friedger
Copy link
Member

friedger commented Oct 7, 2017

I am worried about the non-standard mime type, as well as the FileUriExposedException when using the file schema.

Could you please propose something with FileProvider?

@k3b
Copy link
Contributor

k3b commented Oct 8, 2017

I agree that we should use the "standard".

Unfortunately there is none (at least none i am aware of or one that is widley known or widly implemented)

In my opinion the best way is to use something that other have implemented or is willing/planning/thinking about to implement.

therefore i am lobbying for this proposal.

If you think that we should follow an other "standard" as discussed in https://stackoverflow.com/questions/18869772/mime-type-for-a-directory it may be a compromise and easy to to implement several different "standards":

If you think we should use a different format, please let us know which one you like to support so i will integrate additional logic into my own "show in filemanager" logic to try different standards


fileuriexposedexception since android n/sdk-24 does this mean we have to hide "file:" from android if we want to have a "show in filemanager" function in our apps ?

@friedger
Copy link
Member

friedger commented Oct 8, 2017

I would go for vnd.android.document/directory as some file managers also can show online storage. I have opened an issue at the google issue tracker for FileProvider.getType() https://issuetracker.google.com/issues/67545552

And yes, you should get ride of the file scheme.

@k3b
Copy link
Contributor

k3b commented Oct 8, 2017

ok thanks for feedback. my app will try vnd.android.document/directory and if not found try resource/folder

@friedger
Copy link
Member

friedger commented Oct 9, 2017

I have created a sample app on https://github.com/openintents/directory-type

As the uri does not contain any hints about the directory path, you need to add an extra string with the absolute path in your VIEW action.

I suggest something like the provider column name of MediaStore https://developer.android.com/reference/android/provider/MediaStore.MediaColumns.html#DATA or the extra to show the initial folder when opening a document https://developer.android.com/reference/android/provider/DocumentsContract.html#EXTRA_INITIAL_URI

My suggestion is

org.openintents.extra.ABSOLUTE_PATH

@k3b
Copy link
Contributor

k3b commented Oct 9, 2017

i woult propose to use org.openintents.extra.ABSOLUTE_PATH.
And if this extra is not set use data-uri. (file:uri with a directory) Other cloud-aware filemanagers can use cloud spefic directory-urls.

this way it is compatible with the other view actions without the need for a new extra parameter.

@friedger
Copy link
Member

friedger commented Oct 9, 2017

I have added documentation for this at
http://www.openintents.org/action/android-intent-action-view/file-directory

Thanks for the discussion!

friedger added a commit that referenced this issue Mar 1, 2018
Fixed typo in intents to open dir for #87: singular instead of plural…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants