Package jadex.commons
Interface SUtil.AndroidUtils
-
- Enclosing class:
- SUtil
public static interface SUtil.AndroidUtils
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringapkPathFromUrl(java.net.URL url)Retrieves the APK Path from a given URL, if its an Android APK URL.java.util.Collection<? extends java.net.URL>collectDexPathUrls(java.lang.ClassLoader classloader)Traverse the Hierarchy of the given classloader and collect all DexPaths that are found as URLs.java.lang.ClassLoaderfindJadexDexClassLoader(java.lang.ClassLoader cl)Looks up the ClassLoader Hierarchy and tries to find a JadexDexClassLoader in it.intgetAndroidVersion()Get Android API version.java.util.Enumeration<java.lang.String>getDexEntries(java.io.File dexFile)Get all Classes in a dex file as Enumeration.booleanhasXmlSupport()Checks whether the Platform has the necessary classes to provide XML encoding and decoding support.booleanrunningOnUiThread()Check whether the current Thread is the android UI thread.java.net.URLurlFromApkPath(java.lang.String apkPath)Creates an URL object from a given Path to an android APK file
-
-
-
Method Detail
-
getAndroidVersion
int getAndroidVersion()
Get Android API version. Possible values: http://developer.android.com/reference/android/os/Build.VERSION_CODES.html- Returns:
- Android API version
-
collectDexPathUrls
java.util.Collection<? extends java.net.URL> collectDexPathUrls(java.lang.ClassLoader classloader)
Traverse the Hierarchy of the given classloader and collect all DexPaths that are found as URLs.- Parameters:
classloader-- Returns:
- URLs
-
hasXmlSupport
boolean hasXmlSupport()
Checks whether the Platform has the necessary classes to provide XML encoding and decoding support.- Returns:
- true, if platform supports xml
-
findJadexDexClassLoader
java.lang.ClassLoader findJadexDexClassLoader(java.lang.ClassLoader cl)
Looks up the ClassLoader Hierarchy and tries to find a JadexDexClassLoader in it.- Parameters:
cl-- Returns:
ClassLoaderornull, if none found.
-
urlFromApkPath
java.net.URL urlFromApkPath(java.lang.String apkPath) throws java.net.MalformedURLExceptionCreates an URL object from a given Path to an android APK file- Parameters:
apkPath-- Returns:
URL- Throws:
java.net.MalformedURLException
-
apkPathFromUrl
java.lang.String apkPathFromUrl(java.net.URL url)
Retrieves the APK Path from a given URL, if its an Android APK URL.- Parameters:
url-- Returns:
String
-
getDexEntries
java.util.Enumeration<java.lang.String> getDexEntries(java.io.File dexFile) throws java.io.IOExceptionGet all Classes in a dex file as Enumeration.- Parameters:
dexFile- the dex file- Returns:
- Enumeration of full-qualified classnames
- Throws:
java.io.IOException
-
runningOnUiThread
boolean runningOnUiThread()
Check whether the current Thread is the android UI thread.- Returns:
- true, if current thread is ui main thread.
-
-