docs: documented SD card limitation for android

This commit is contained in:
shnist 2019-02-12 16:47:31 +00:00
parent 70aa95bf1c
commit cddc61214c

View File

@ -51,7 +51,7 @@ Open an APK install dialog:
```javascript ```javascript
cordova.plugins.fileOpener2.open( cordova.plugins.fileOpener2.open(
'/sdcard/Download/gmail.apk', '/Downloads/gmail.apk',
'application/vnd.android.package-archive' 'application/vnd.android.package-archive'
); );
``` ```
@ -60,7 +60,7 @@ Open a PDF document with the default PDF reader and optional callback object:
```js ```js
cordova.plugins.fileOpener2.open( cordova.plugins.fileOpener2.open(
'/sdcard/Download/starwars.pdf', // You can also use a Cordova-style file uri: cdvfile://localhost/persistent/Download/starwars.pdf '/Download/starwars.pdf', // You can also use a Cordova-style file uri: cdvfile://localhost/persistent/Downloads/starwars.pdf
'application/pdf', 'application/pdf',
{ {
error : function(e) { error : function(e) {
@ -99,7 +99,7 @@ Opens with system modal to open file with an already installed app.
```js ```js
cordova.plugins.fileOpener2.showOpenWithDialog( cordova.plugins.fileOpener2.showOpenWithDialog(
'/sdcard/Download/starwars.pdf', // You can also use a Cordova-style file uri: cdvfile://localhost/persistent/Download/starwars.pdf '/Downloads/starwars.pdf', // You can also use a Cordova-style file uri: cdvfile://localhost/persistent/Downloads/starwars.pdf
'application/pdf', 'application/pdf',
{ {
error : function(e) { error : function(e) {
@ -170,6 +170,12 @@ The following limitations apply when opening an APK file for installation:
--- ---
## SD card limitation on Android
It is not always possible to open a file from the SD Card using this plugin on Android. This is because the underlying Android library used [does not support serving files from secondary external storage devices](https://stackoverflow.com/questions/40318116/fileprovider-and-secondary-external-storage). Whether or not your the SD card is treated as a secondary external device depends on your particular phone's set up.
---
## Notes ## Notes
- For properly opening _any_ file, you must already have a suitable reader for that particular file type installed on your device. Otherwise this will not work. - For properly opening _any_ file, you must already have a suitable reader for that particular file type installed on your device. Otherwise this will not work.