System directories
| Method | Result |
|---|---|
| Environment.getDataDirectory() | /data |
| Environment.getDownloadCacheDirectory() | /cache |
| Environment.getRootDirectory() | /system |
External storage directories
| package com.example.fconfig; | |
| import android.os.Bundle; | |
| import android.support.annotation.NonNull; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.util.Log; | |
| import android.view.View; | |
| import android.widget.TextView; | |
| import com.google.android.gms.tasks.OnCompleteListener; |
| import android.graphics.Rect; | |
| import android.support.v7.widget.GridLayoutManager; | |
| import android.support.v7.widget.RecyclerView; | |
| import android.view.View; | |
| public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration { | |
| private final int spacing; | |
| private int displayMode; | |
| public static final int HORIZONTAL = 0; |
| String sdCardPath = null; | |
| if (storageState.equals(Environment.MEDIA_MOUNTED)) { | |
| sdCardPath = Environment.getExternalStorageDirectory().getAbsolutePath(); | |
| } else { | |
| List<String> possiblePaths = new ArrayList<String>(); | |
| possiblePaths.add("/storage/sdcard1 "); //!< Motorola Xoom | |
| possiblePaths.add("/storage/extsdcard "); //!< Samsung SGS3 | |
| possiblePaths.add("/storage/sdcard0/external_sdcard"); // user request | |
| possiblePaths.add("/mnt/extsdcard"); |
| private String getSdcardFolder() { | |
| File externalStorage = Environment.getExternalStorageDirectory(); | |
| if (externalStorage.exists() && externalStorage.canWrite()) { | |
| File trySubDir1 = new File(externalStorage, "external_sd"); | |
| File trySubDir2 = new File(externalStorage, "sd"); | |
| if (trySubDir1.exists() && trySubDir1.canWrite()) { | |
| return trySubDir1.getAbsolutePath(); | |
| } else if (trySubDir2.exists() && trySubDir2.canWrite()) { | |
| return trySubDir2.getAbsolutePath(); | |
| } else { |
System directories
| Method | Result |
|---|---|
| Environment.getDataDirectory() | /data |
| Environment.getDownloadCacheDirectory() | /cache |
| Environment.getRootDirectory() | /system |
External storage directories
| public static String getExternalSdCardPath() { | |
| String path = null; | |
| File sdCardFile = null; | |
| List<String> sdCardPossiblePath = Arrays.asList("external_sd", "ext_sd", "external", "extSdCard"); | |
| for (String sdPath : sdCardPossiblePath) { | |
| File file = new File("/mnt/", sdPath); | |
| if (file.isDirectory() && file.canWrite()) { |
| // Extension on intent | |
| fun Intent?.getFilePath(context: Context): String { | |
| return this?.data?.let { data -> RealPathUtil.getRealPath(context, data) ?: "" } ?: "" | |
| } | |
| fun Uri?.getFilePath(context: Context): String { | |
| return this?.let { uri -> RealPathUtil.getRealPath(context, uri) ?: "" } ?: "" | |
| } |
| public static String[] getStorageDirectories() { | |
| final Pattern DIR_SEPARATOR = Pattern.compile("/"); | |
| // Final set of paths | |
| final Set<String> rv = new HashSet<String>(); | |
| // Primary physical SD-CARD (not emulated) | |
| final String rawExternalStorage = System.getenv("EXTERNAL_STORAGE"); | |
| // All Secondary SD-CARDs (all exclude primary) separated by ":" | |
| final String rawSecondaryStoragesStr = System.getenv("SECONDARY_STORAGE"); | |
| // Primary emulated SD-CARD |
Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...
Italics *italics* or _italics_
Underline italics __*underline italics*__
| import android.annotation.SuppressLint; | |
| import android.content.ContentUris; | |
| import android.content.Context; | |
| import android.database.Cursor; | |
| import android.net.Uri; | |
| import android.os.Build; | |
| import android.os.Environment; | |
| import android.provider.DocumentsContract; | |
| import android.provider.MediaStore; | |
| import android.support.v4.content.CursorLoader; |