Android: Read a file without external storage permission -


i don't want app require permissions, want user able select file reading. app doesn't need arbitrary access filesystem. however, openfiledialog implementations have researched far seem assume permission access external storage.

one workaround can think of configure app among list of apps open type of file. haven't tried this, hope work without permission access external storage. however, user guidance less ideal in case. prefer solution dialog , have user pick file.

i think requirement not undermine security, because user has full control on file app can read. possible somehow?

however, openfiledialog implementations have researched far seem assume permission access external storage.

set minsdkversion 19, use action_open_document, part of the storage access framework.

or, if need minsdkversion below 19, use action_get_content on older devices.

you uri via onactivityresult(). use contentresolver , methods openinputstream() consume content identified uri.

i haven't tried this, hope work without permission access external storage

only if exclude file: uri values. example, <intent-filter> supports content: uri values work.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -