public class AndroidContextUtil extends Object
Constructor and Description |
---|
AndroidContextUtil() |
AndroidContextUtil(ContextWrapper contextWrapper) |
Modifier and Type | Method and Description |
---|---|
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() |
String |
getVersionCode() |
String |
getVersionName() |
void |
setupProperties(LoggerContext context)
Sets properties for use in configs
|
public AndroidContextUtil()
public AndroidContextUtil(ContextWrapper contextWrapper)
public void setupProperties(LoggerContext context)
context
- logger context whose property map is updatedpublic 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 getDatabaseDirectoryPath()
public String getVersionCode()
public String getVersionName()