Android Open Source - TextFileXpanderAndroid External Storage






From Project

Back to project page TextFileXpanderAndroid.

License

The source code is released under:

Apache License

If you think the Android project TextFileXpanderAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

//
//  ExternalStorage.java
//  TextFileXpander
///*from   w w  w . ja  v  a2 s . co m*/
//  Created by wanswings on 2014/08/25.
//  Copyright (c) 2014 wanswings. All rights reserved.
//
package com.wanswings.TextFileXpander;

import android.content.Context;
import android.os.Environment;
import android.util.Log;
import android.widget.Toast;

public class ExternalStorage extends Storage {

  private String classNameForLog;

  public ExternalStorage(Context ap, boolean refresh, StorageListenerInterface listener) {
    super(ap, refresh, listener);

    classNameForLog = this.getClass().getName() + "...";

    topPath = Environment.getExternalStorageDirectory().getPath();
    Log.i(packageName, classNameForLog + "getExternalStorageDirectory..." + topPath);

    selectDir();
  }

  @Override
  public boolean isStorageAvailable() {
    boolean result = false;

    String state = Environment.getExternalStorageState();
    if (Environment.MEDIA_MOUNTED.equals(state)) {
      result = true;
    }
    else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
      result = true;
    }

    if (!result) {
      Toast.makeText(mContext, R.string.error_external_storage_not_ready, Toast.LENGTH_LONG).show();
    }

    return result;
  }
}




Java Source Code List

com.wanswings.TextFileXpander.AuthCommon.java
com.wanswings.TextFileXpander.BootCompletedBroadcastReceiver.java
com.wanswings.TextFileXpander.CustomAdapter.java
com.wanswings.TextFileXpander.CustomExpandableListAdapter.java
com.wanswings.TextFileXpander.DropboxAuthActivity.java
com.wanswings.TextFileXpander.Dropbox.java
com.wanswings.TextFileXpander.ExternalStorage.java
com.wanswings.TextFileXpander.GoogleAuthActivity.java
com.wanswings.TextFileXpander.GoogleDrive.java
com.wanswings.TextFileXpander.MainActivity.java
com.wanswings.TextFileXpander.PrivateSharedPrefs.java
com.wanswings.TextFileXpander.PushData.java
com.wanswings.TextFileXpander.StorageListenerInterface.java
com.wanswings.TextFileXpander.Storage.java
com.wanswings.TextFileXpander.SubActivity.java
com.wanswings.TextFileXpander.TextViewActivity.java