public class AndroidEventBuilderHelper extends Object implements EventBuilderHelper
| Constructor and Description |
|---|
AndroidEventBuilderHelper(android.content.Context ctx)
Construct given the provided Android
Context. |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
getApplicationName(android.content.Context ctx)
Get the human-facing Application name.
|
protected static Float |
getBatteryLevel(android.content.Context ctx)
Get the device's current battery level (as a percentage of total).
|
protected Map<String,Map<String,Object>> |
getContexts() |
protected static android.util.DisplayMetrics |
getDisplayMetrics(android.content.Context ctx)
Get the DisplayMetrics object for the current application.
|
protected static String |
getFamily()
Fake the device family by using the first word in the Build.MODEL.
|
protected static String |
getKernelVersion()
Get the device's current kernel version, as a string.
|
protected static android.app.ActivityManager.MemoryInfo |
getMemInfo(android.content.Context ctx)
Get MemoryInfo object representing the memory state of the application.
|
protected static String |
getOrientation(android.content.Context ctx)
Get the device's current screen orientation.
|
protected static android.content.pm.PackageInfo |
getPackageInfo(android.content.Context ctx)
Return the Application's PackageInfo if possible, or null.
|
protected static String[] |
getProGuardUuids(android.content.Context ctx) |
protected static Long |
getTotalExternalStorage()
Get the total amount of external storage, in bytes, or null if no external storage
is mounted.
|
protected static Long |
getTotalInternalStorage()
Get the total amount of internal storage, in bytes.
|
protected static Long |
getUnusedExternalStorage()
Get the unused amount of external storage, in bytes, or null if no external storage
is mounted.
|
protected static Long |
getUnusedInternalStorage()
Get the unused amount of internal storage, in bytes.
|
void |
helpBuildingEvent(EventBuilder eventBuilder) |
protected static Boolean |
isCharging(android.content.Context ctx)
Checks whether or not the device is currently plugged in and charging, or null if unknown.
|
protected static boolean |
isConnected(android.content.Context ctx)
Check whether the application has internet access at a point in time.
|
protected static Boolean |
isEmulator()
Check whether the application is running in an emulator.
|
protected static boolean |
isExternalStorageMounted() |
protected static Boolean |
isRooted()
Attempt to discover if this device is currently rooted.
|
protected static String |
stringifyDate(Date date)
Formats the given Date object into an ISO8601 String.
|
public static final String TAG
public AndroidEventBuilderHelper(android.content.Context ctx)
Context.ctx - Android application context.public void helpBuildingEvent(EventBuilder eventBuilder)
helpBuildingEvent in interface EventBuilderHelperprotected static String[] getProGuardUuids(android.content.Context ctx)
protected static android.content.pm.PackageInfo getPackageInfo(android.content.Context ctx)
ctx - Android application contextprotected static String getFamily()
protected static Boolean isEmulator()
protected static android.app.ActivityManager.MemoryInfo getMemInfo(android.content.Context ctx)
ctx - Android application contextprotected static String getOrientation(android.content.Context ctx)
ctx - Android application contextprotected static Float getBatteryLevel(android.content.Context ctx)
ctx - Android application contextprotected static Boolean isCharging(android.content.Context ctx)
ctx - Android application contextprotected static String getKernelVersion()
protected static Boolean isRooted()
protected static boolean isExternalStorageMounted()
protected static Long getUnusedInternalStorage()
protected static Long getTotalInternalStorage()
protected static Long getUnusedExternalStorage()
protected static Long getTotalExternalStorage()
protected static android.util.DisplayMetrics getDisplayMetrics(android.content.Context ctx)
ctx - Android application contextprotected static String stringifyDate(Date date)
date - Date to format as ISO8601protected static String getApplicationName(android.content.Context ctx)
ctx - Android application contextprotected static boolean isConnected(android.content.Context ctx)
ctx - Android application contextCopyright © 2012–2019. All rights reserved.