Java Code Examples for com.grarak.kerneladiutor.utils.Utils#getExternalStorage()

The following examples show how to use com.grarak.kerneladiutor.utils.Utils#getExternalStorage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FileBrowserActivity.java    From KA27 with Apache License 2.0 5 votes vote down vote up
@Override
public void init(Bundle savedInstanceState) {
    super.init(savedInstanceState);

    String fileType = getArguments().getString(FILE_TYPE_ARG);
    String externalStorage = Utils.getExternalStorage();

    fileBrowserActivity.internalStorage =
        StorageFragment.newInstance(Environment.getExternalStorageDirectory().getPath(), fileType);
    addFragment(new ViewPagerItem(fileBrowserActivity.internalStorage, getString(R.string.internal_storage)));
    if (externalStorage != null) {
        fileBrowserActivity.externalStorage = StorageFragment.newInstance(externalStorage, fileType);
        addFragment(new ViewPagerItem(fileBrowserActivity.externalStorage, getString(R.string.external_storage)));
    }
}
 
Example 2
Source File: Recovery.java    From KA27 with Apache License 2.0 5 votes vote down vote up
public String formatFile(File file) {
    String zip = file.getAbsolutePath();

    String internalStorage = Environment.getExternalStorageDirectory().toString();
    if (zip.startsWith(internalStorage + "/"))
        return zip.replace(internalStorage + "/", Utils.getInternalStorage() + "/");

    String externalStorage = Utils.getExternalStorage();
    if (externalStorage != null && zip.startsWith(externalStorage + "/"))
        return zip.replace(externalStorage + "/", getExternalPath() + "/");

    return zip;
}
 
Example 3
Source File: Recovery.java    From KernelAdiutor with GNU General Public License v3.0 5 votes vote down vote up
public String formatFile(File file) {
    String zip = file.getAbsolutePath();

    String internalStorage = Environment.getExternalStorageDirectory().toString();
    if (zip.startsWith(internalStorage + "/")) {
        return zip.replace(internalStorage + "/", "/sdcard/");
    }

    String externalStorage = Utils.getExternalStorage();
    if (externalStorage != null && zip.startsWith(externalStorage + "/")) {
        return zip.replace(externalStorage + "/", getExternalPath() + "/");
    }

    return zip;
}