public class AndroidContextUtil extends Object
Constructor and Description |
---|
AndroidContextUtil() |
AndroidContextUtil(ContextWrapper contextWrapper) |
Modifier and Type | Method and Description |
---|---|
String |
getAssetsDirectoryPath()
Gets the relative path to the assets directory within the jar
|
String |
getCacheDirectoryPath() |
String |
getDatabaseDirectoryPath()
Returns the absolute path to the directory on the Android
filesystem where databases are stored for the current application.
|
String |
getDatabasePath(String databaseName) |
String |
getExternalCacheDirectoryPath() |
String |
getExternalFilesDirectoryPath() |
String |
getExternalStorageDirectoryPath()
Gets the path to the external storage directory
|
String |
getFilesDirectoryPath()
Returns the absolute path to the directory on the Android
filesystem where files are stored for the current application.
|
String |
getMountedExternalStorageDirectoryPath()
Gets the path to the external storage directory only if
mounted.
|
String |
getNoBackupFilesDirectoryPath()
Returns the absolute path to the directory on the Android
filesystem similar to
getFilesDirectoryPath() . |
String |
getPackageName() |
public AndroidContextUtil()
public AndroidContextUtil(ContextWrapper contextWrapper)
public String getMountedExternalStorageDirectoryPath()
null
if not mounted.public String getExternalStorageDirectoryPath()
public String getExternalFilesDirectoryPath()
public String getCacheDirectoryPath()
public String getExternalCacheDirectoryPath()
public String getPackageName()
public String getFilesDirectoryPath()
public String getNoBackupFilesDirectoryPath()
getFilesDirectoryPath()
.
The difference is these files are excluded from automatic
backup to remote storage by BackupAgent
.
This API is only available on SDK 21+. On older versions,
this function returns an empty string.public String getAssetsDirectoryPath()
public String getDatabaseDirectoryPath()