diff --git a/res/values/strings.xml b/res/values/strings.xml
index ce9522496..5cc25effe 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -141,4 +141,5 @@
We are glad to have you on board and would appreciate any feedback or suggestions.
Storage
Current Folder
+ Can't access desired directory, using default. To fix this reselect the desired directory in app settings.
diff --git a/src/org/kiwix/kiwixmobile/downloader/DownloadService.java b/src/org/kiwix/kiwixmobile/downloader/DownloadService.java
index 2ed5f4233..af5c23781 100644
--- a/src/org/kiwix/kiwixmobile/downloader/DownloadService.java
+++ b/src/org/kiwix/kiwixmobile/downloader/DownloadService.java
@@ -20,6 +20,7 @@ import android.support.annotation.Nullable;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import android.util.Pair;
+import android.widget.Toast;
import java.io.File;
import java.io.IOException;
@@ -90,6 +91,7 @@ public class DownloadService extends Service {
.getString(KiwixMobileActivity.PREF_STORAGE,Environment.getExternalStorageDirectory().getPath());
KIWIX_ROOT = SD_CARD + "/Kiwix/";
+ KIWIX_ROOT = checkWritable(KIWIX_ROOT);
notificationTitle = intent.getExtras().getString(DownloadIntent.DOWNLOAD_ZIM_TITLE);
LibraryNetworkEntity.Book book = (LibraryNetworkEntity.Book) intent.getSerializableExtra("Book");
@@ -129,6 +131,12 @@ public class DownloadService extends Service {
notificationManager.cancel(notificationID);
}
+ public String checkWritable(String path){
+ if (new File(path).canWrite())
+ return path;
+ Toast.makeText(this, getResources().getString(R.string.path_not_writable), Toast.LENGTH_LONG).show();
+ return Environment.getExternalStorageDirectory().getPath();
+ }
public void pauseDownload(int notificationID) {
downloadStatus.put(notificationID, 1);