com.metaio.tools
Class SystemInfo

java.lang.Object
  extended by com.metaio.tools.SystemInfo

public final class SystemInfo
extends Object

This class provides helper functions to retrieve various system information

Author:
arsalan.malik

Constructor Summary
SystemInfo()
           
 
Method Summary
static int getCameraIndex(int facing)
          Get first index of the front or back facing camera
static float getDisplayDensity(Context context)
          Get display pixel density
static int getNumCPUCores()
          Gets the number of CPU cores available on this device, across all processors.
static boolean isCPUSupported()
          Determine if device CPU is supported by metaio SDK
static boolean isEmulator()
          Determine if running on Android Emulator
static boolean isTablet(Context context)
          Determine if the device is a tablet.
static String readCPUInfo()
          Read CPU information by running a system command
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemInfo

public SystemInfo()
Method Detail

getNumCPUCores

public static int getNumCPUCores()
Gets the number of CPU cores available on this device, across all processors. Requires: Ability to peruse the filesystem at "/sys/devices/system/cpu"

Source: StackOverflow

Returns:
The number of cores, or 1 if failed to get result

isEmulator

public static boolean isEmulator()
Determine if running on Android Emulator

Returns:
true if running on emulator, false if running on device

isTablet

public static boolean isTablet(Context context)
Determine if the device is a tablet.

Returns:
if the device is a tablet, else

isCPUSupported

public static boolean isCPUSupported()
Determine if device CPU is supported by metaio SDK

Returns:
true if supported, else false

readCPUInfo

public static String readCPUInfo()
Read CPU information by running a system command

Returns:
String containing CPU information

getCameraIndex

public static int getCameraIndex(int facing)
Get first index of the front or back facing camera

Parameters:
facing - CameraInfo#CAMERA_FACING_BACK or CameraInfo#CAMERA_FACING_FRONT
Returns:
Valid camera index on sucess, -1 if camera not found

getDisplayDensity

public static float getDisplayDensity(Context context)
Get display pixel density

Parameters:
context - Application context
Returns:
Display pixel density as PPI