[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs for Android] How to open file with an external app?
From: |
Po Lu |
Subject: |
Re: [Emacs for Android] How to open file with an external app? |
Date: |
Wed, 23 Aug 2023 07:45:51 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Antonio Romano <n58r@pm.me> writes:
> I tried the following
> (android-browse-url
> "content://org.nextcloud.documents/2a368.../Ebooks/effectiveawk.epub")
>
> and got the following error:
>
> java.lang.SecurityException: UID 10713 does not have permission to
> "/content/storage/org.nextcloud.documents/2a3683ac919807f000715758ea81ef61%2F665/Ebooks/effectiveawk.epub"
>
> [user 0]; you could obtain access using ACTION_OPEN_DOCUMENT
> or related
> apis
>
> But I'm pretty sure Emacs has the permission to access the Nextcloud
> document provider, since i can open buffers in it without any
> trouble. Maybe i got the URI wrong?
These permissions are granted exclusively to Emacs, and transferring
them to other programs is not possible.
> I can also open document provider in a file manager called MiXplorer:
> i navigated Nextcloud through it and, strangely enough, it seems that
> MiXplorer gives its own content URIs to files:
>
> "content://com.mixplorer.file/1409260714!/Ebooks/effectiveawk.epub"
It's probably copying the file to a temporary location, which is
subsequently made available to other programs.
>
> which, if gives as argument to (android-browse-url), makes the "Open
> with..." menu appear.
>
> Document providers look like a mess to me. What's the easiest way to
> externally open files in "/content/storage/org.nextcloud/documents/"?
Probably what I outlined above: copy the file to a location in the Unix
VFS (outside /content or /assets), before providing the copy to other
programs.