Skip to content

Commit

Permalink
docs: documented SD card limitation for android
Browse files Browse the repository at this point in the history
  • Loading branch information
shnist committed Feb 12, 2019
1 parent 70aa95b commit cddc612
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Open an APK install dialog:

```javascript
cordova.plugins.fileOpener2.open(
'/sdcard/Download/gmail.apk',
'/Downloads/gmail.apk',
'application/vnd.android.package-archive'
);
```
Expand All @@ -60,7 +60,7 @@ Open a PDF document with the default PDF reader and optional callback object:

```js
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',
{
error : function(e) {
Expand Down Expand Up @@ -99,7 +99,7 @@ Opens with system modal to open file with an already installed app.

```js
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',
{
error : function(e) {
Expand Down Expand Up @@ -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

- 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.
Expand Down

0 comments on commit cddc612

Please sign in to comment.