Exemplo n.º 1
0
 /** Возвращает каталог для бекапа на внешнее хранилище, или null если хранилище не подключено */
 @Override
 public File getBackupDir() {
   File dir = null;
   if (StorageHelper.isExternalStorageAvailable()) {
     dir = StorageHelper.getAppBackup(getContext());
   }
   return dir;
 }
Exemplo n.º 2
0
  /** Возвращает каталог для временных файлов приложения, с приоритетом на внешнее хранилище */
  @Override
  public File getCacheDir() {

    File dir = null;
    if (AppHelper.isAppInstalledToSDCard(getContext())
        && StorageHelper.isExternalStorageAvailable()) {

      dir = StorageHelper.getExternalAppCashe(getContext());
    }
    if (dir == null) {
      dir = getContext().getCacheDir();
    }

    return dir;
  }