- java.lang.Object
-
- org.arakhne.afc.vmutil.Android
-
public final class Android extends Object
This class stores several information given by the Android operating systems. The stored informations are used by the arakhneVmutil tools to proceed several tasks, such asOperatingSystem
.- Since:
- 7.0
- Version:
- 17.0 2020-01-04 14:41:35
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- vmutils
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Android.AndroidException
This exception is thrown when theAndroid
attributes are not correctly initialized.
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIGURATION_DIRECTORY
Name of the system-wide configuration directory.static String
DATA_DIRECTORY
Name of the system-wide data directory.static String
HOME_DIRECTORY
Name of the home directory.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
getContext()
Replies the currentContext
for the android task.static Class<?>
getContextClass()
Replies the classContext
from Android.static ClassLoader
getContextClassLoader()
Replies the class loader of the current Android context.static Object
getContextResolver()
Replies the currentContextResolver
for the android task.static Class<?>
getContextResolverClass()
Replies the classContextResolver
from Android.static Class<?>
getSecureSettingsClass()
Replies the classSecure
from Android.static Class<?>
getSystemSettingsClass()
Replies the classSecure
from Android.static void
initialize(Object androidContext)
Extract informations from the currentContext
of the android task.static String
makeAndroidApplicationName(String applicationName)
Make a valid android application name from the given application name.
-
-
-
Field Detail
-
HOME_DIRECTORY
public static final String HOME_DIRECTORY
Name of the home directory.- See Also:
- Constant Field Values
-
CONFIGURATION_DIRECTORY
public static final String CONFIGURATION_DIRECTORY
Name of the system-wide configuration directory.- See Also:
- Constant Field Values
-
DATA_DIRECTORY
public static final String DATA_DIRECTORY
Name of the system-wide data directory.- See Also:
- Constant Field Values
-
-
Method Detail
-
makeAndroidApplicationName
@Pure public static String makeAndroidApplicationName(String applicationName)
Make a valid android application name from the given application name. A valid android application name is a package name followed by the name of the application.- Parameters:
applicationName
- is the simple application name.- Returns:
- the android application name.
-
getContextClass
@Pure public static Class<?> getContextClass() throws Android.AndroidException
Replies the classContext
from Android.- Returns:
- the class
Context
from Android. - Throws:
Android.AndroidException
- when the class cannot be found.
-
getContextResolverClass
@Pure public static Class<?> getContextResolverClass() throws Android.AndroidException
Replies the classContextResolver
from Android.- Returns:
- the class
ContextResolver
from Android. - Throws:
Android.AndroidException
- when the class cannot be found.
-
getSecureSettingsClass
@Pure public static Class<?> getSecureSettingsClass() throws Android.AndroidException
Replies the classSecure
from Android.- Returns:
- the class
Secure
from Android. - Throws:
Android.AndroidException
- when the class cannot be found.
-
getSystemSettingsClass
@Pure public static Class<?> getSystemSettingsClass() throws Android.AndroidException
Replies the classSecure
from Android.- Returns:
- the class
Secure
from Android. - Throws:
Android.AndroidException
- when the class cannot be found.
-
initialize
public static void initialize(Object androidContext) throws Android.AndroidException
Extract informations from the currentContext
of the android task.- Parameters:
androidContext
- is the AndroidContext
.- Throws:
Android.AndroidException
- when the information cannot be extracted.
-
getContext
@Pure public static Object getContext() throws Android.AndroidException
Replies the currentContext
for the android task.- Returns:
- the current
Context
for the android task. - Throws:
Android.AndroidException
- when the context isnull
.- See Also:
initialize(Object)
-
getContextClassLoader
@Pure public static ClassLoader getContextClassLoader() throws Android.AndroidException
Replies the class loader of the current Android context.- Returns:
- class loader used by the current Android context.
- Throws:
Android.AndroidException
- when the context isnull
.- See Also:
initialize(Object)
-
getContextResolver
@Pure public static Object getContextResolver() throws Android.AndroidException
Replies the currentContextResolver
for the android task.- Returns:
- the current
ContextResolver
for the android task. - Throws:
Android.AndroidException
- when the context isnull
.- See Also:
initialize(java.lang.Object)
-
-