Skip to content
Nishant Srivastava edited this page Jun 24, 2016 · 30 revisions

Create an instance of Easy*Mod class, i.e EasyConfigMod

EasyConfigMod easyConfigMod = new EasyConfigMod(context);

Next call an available function on the easyConfigMod instance such as

String time_in_ms= String.valueOf(easyConfigMod.getTime());

Now each Mods houses a certain set of functions you can use to retrieve device information.

The list is as follows

EasyIdMod

EasyIdMod easyIdMod = new EasyIdMod(context);
Value functionName returns
PseudoID getPseudoUniqueID() String
Android ID getAndroidID() String

More Functions

  • To get User-Agent, call it from the UI thread ONLY

      String ua = easyDeviceMod.getUA()
  • To get GSF ID

    String gsf_id = getGSFID();
    • Include the required permission in your AndroidManifest.xml
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
  • To get Email IDs

    //Get Google Email ID
    String[] emailIds = easyIdMod.getAccounts();
      StringBuilder emailString = new StringBuilder();
      if (emailIds != null && emailIds.length > 0) {
        for (String e : emailIds) {
          emailString.append(e).append("\n");
        }
      } else {
        emailString.append("-");
      }
    
    String emailId=emailString.toString();
    • Include the required permission in your AndroidManifest.xml
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
  • To get Advertiser's ID

        //Get Android Advertiser ID
        easyIdMod.getAndroidAdId(MainActivity.this, new EasyIdMod.AdIdentifierCallback() {
          @Override
          public void onSuccess(String adIdentifier, boolean adDonotTrack) {
             // Do something with the advertiser's ID
          }
     });

EasyConfigMod

EasyConfigMod easyConfigMod = new EasyConfigMod(context);
Value functionName returns
Is running on emulator isRunningOnEmulator() boolean
Time (ms) getTime() long
Formatted Time (24Hr) getFormattedTime() String
Up Time (ms) getUpTime() long
Formatted Up Time (24Hr) getFormattedUpTime() String

Functions which return multiple results

  • Device Ringer Mode
    int ringer_mode =easyConfigMod.getDeviceRingerMode();

Then match it against the constants provided

switch (ringer_mode) {
    case EasyConfigMod.RINGER_MODE_NORMAL:
      System.out.println("Ringer mode : Normal");
      break;
    case EasyConfigMod.RINGER_MODE_VIBRATE:
      System.out.println("Ringer mode : Vibrate");
      break;
    case EasyConfigMod.RINGER_MODE_SILENT:
      System.out.println("Ringer mode : Silent");
      break;
    default:
      //do nothing
      break;
  }

where constants available are + EasyConfigMod.RINGER_MODE_NORMAL + EasyConfigMod.RINGER_MODE_VIBRATE + EasyConfigMod.RINGER_MODE_SILENT

EasyNetworkMod

EasyNetworkMod easyNetworkMod = new EasyNetworkMod(context);
Value functionName returns
WiFi State isNetworkAvailable() boolean
WiFi State isWifiEnabled() boolean
IPv4 Address getIPv4Address() String
IPv6 Address getIPv6Address() String
  • To get WiFi MAC Address

    String wifi_mac = easyNetworkMod.getWifiMAC();
    • Include the required permission in your AndroidManifest.xml
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

Functions which return multiple results

  • To get network type

    int network_type =easyNetworkMod.getNetworkType();

    Then match it against the constants provided

switch () { case EasyNetworkMod.CELLULAR_UNKNOWN: System.out.println("Network Type : Unknown"); break; case EasyNetworkMod.CELLULAR_UNIDENTIFIED_GEN: System.out.println("Network Type : Cellular Unidentified Generation"); break; case EasyNetworkMod.CELLULAR_2G: System.out.println("Network Type : Cellular 2G"); break; case EasyNetworkMod.CELLULAR_3G: System.out.println("Network Type : Cellular 3G"); break; case EasyNetworkMod.CELLULAR_4G: System.out.println("Network Type : Cellular 4G"); break; case EasyNetworkMod.WIFI_WIFIMAX: System.out.println("Network Type : WIFI"); break; default: // Do nothing break; }


where constants available are 
  + `EasyNetworkMod.CELLULAR_UNKNOWN`
  + `EasyNetworkMod.CELLULAR_UNIDENTIFIED_GEN`
  + `EasyNetworkMod.CELLULAR_2G`
  + `EasyNetworkMod.CELLULAR_3G`
  + `EasyNetworkMod.CELLULAR_4G`
  + `EasyNetworkMod.WIFI_WIFIMAX`

+ Include the required permission in your AndroidManifest.xml
 ```xml
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>

EasyMemoryMod

EasyMemoryMod easyMemoryMod = new EasyMemoryMod(context);
Value functionName returns
Total RAM(Mb) getTotalRAM() long
Available Internal Memory(Mb) getAvailableInternalMemorySize() long
Available External Memory(Mb) getAvailableExternalMemorySize() long
Total Internal Memory(Mb) getTotalInternalMemorySize() long
Total External Memory(Mb) getTotalExternalMemorySize() long

EasyAppMod

EasyAppMod easyAppMod = new EasyAppMod(context);
Value functionName returns
Activity Name getActivityName() String
Package Name getPackageName() String
AppStore getStore() String
App Name getAppName() String
App Version getAppVersion() String
App Version Code getAppVersionCode() String

EasyBatteryMod

EasyBatteryMod easyBatteryMod = new EasyBatteryMod(context);
Value functionName returns
Battery Percentage (%) getBatteryPercentage() int
Is Device Charging isDeviceCharging() boolean
Technology used by battery getBatteryTechnology() String
Temperature (Deg Celsius) getBatteryTemperature() float
Voltage (mV) getBatteryVoltage() int
Is battery present isBatteryPresent() boolean

Functions which return multiple results

  • Battery Health
    int battery_health =easyBatteryMod.getBatteryHealth();

Then match it against the constants provided

switch (battery_health) {
    case EasyBatteryMod.HEALTH_GOOD:
      System.out.println("Battery health : Good");
      break;
    case EasyBatteryMod.HEALTH_HAVING_ISSUES:
      System.out.println("Battery health : Having issues");
      break;
    default:
      System.out.println("Battery health : Having issues");
      break;
  }

where constants available are + EasyBatteryMod.HEALTH_GOOD + EasyBatteryMod.HEALTH_HAVING_ISSUES

  • Charging Source
    int charging_source =easyBatteryMod.getChargingSource();

Then match it against the constants provided

switch (charging_source) {
    case EasyBatteryMod.CHARGING_VIA_AC:
      System.out.println("Device charging via AC");
      break;
    case EasyBatteryMod.CHARGING_VIA_USB:
      System.out.println("Device charging via USB");
      break;
    case EasyBatteryMod.CHARGING_VIA_WIRELESS:
      System.out.println("Device charging via Wireless");
      break;
    case EasyBatteryMod.CHARGING_VIA_UNKNOWN_SOURCE:
      System.out.println("Device charging via Unknown Source");
      break;
    default:
      System.out.println("Device charging via Unknown Source");
      break;
  }

where constants available are + EasyBatteryMod.CHARGING_VIA_AC: + EasyBatteryMod.CHARGING_VIA_USB + EasyBatteryMod.CHARGING_VIA_WIRELESS + EasyBatteryMod.CHARGING_VIA_UNKNOWN_SOURCE

EasyBluetoothMod

EasyBluetoothMod easyBluetoothMod = new EasyBluetoothMod(context);
  • To get Bluetooth MAC Address

    String bluetooth_mac = easyBluetoothMod.getBluetoothMAC();
    • Include the required permission in your AndroidManifest.xml
    <uses-permission android:name="android.permission.BLUETOOTH"/>

EasyCpuMod

 EasyCpuMod easyCpuMod = new EasyCpuMod();
Value functionName returns
Supported ABIS getStringSupportedABIS() String
Supported 32 bit ABIS getStringSupported32bitABIS() String
Supported 64 bit ABIS getStringSupported64bitABIS() String

Functions which return multiple results

  • To get Supported ABIS
StringBuilder supportABI = new StringBuilder();
   for (String abis : easyCpuMod.getSupportedABIS()) {
       supportABI.append(abis).append("\n");
   }

String supportedABI=supportABI.toString();
  • To get Supported 32 Bit ABIS
StringBuilder support32ABI = new StringBuilder();
   for (String abis : easyCpuMod.getSupported32bitABIS()) {
       support32ABI.append(abis).append("\n");
   }

String supported32ABI=support32ABI.toString();
  • To get Supported 64 Bit ABIS
StringBuilder support64ABI = new StringBuilder();
   for (String abis : easyCpuMod.getSupported64bitABIS()) {
       support64ABI.append(abis).append("\n");
   }

String supported64ABI=support64ABI.toString();

EasyDeviceMod

 EasyDeviceMod easyDeviceMod = new EasyDeviceMod(context);
Value functionName returns
Screen Display ID getScreenDisplayID() String
Build Version Codename getBuildVersionCodename() String
Build Version Incremental getBuildVersionIncremental() String
Build Version SDK getBuildVersionSDK() int
Build ID getBuildID() String
Manufacturer getManufacturer() String
Model getModel() String
OS Codename getOSCodename() String
OS Version getOSVersion() String
Phone Number getPhoneNo() String
Radio Hardware Version getRadioVer() String
Product getProduct() String
Device getDevice() String
Board getBoard() String
Hardware getHardware() String
Bootloader getBootloader() String
Fingerprint getFingerprint() String
Is Device rooted isDeviceRooted() boolean
Build Brand getBuildBrand() String
Build Host getBuildHost() String
Build Tags getBuildTags() String
Build Time getBuildTime() long
Build User getBuildUser() String
Build Version Release getBuildVersionRelease() String

Functions which return multiple results

  • To get device type

    int device_type = easyDeviceMod.getDeviceType(activity);

    Then match it against the constants provided

    switch (device_type) {
       case EasyDeviceMod.DEVICE_TYPE_WATCH:
         System.out.println("watch");
         break;
       case EasyDeviceMod.DEVICE_TYPE_PHONE:
         System.out.println("phone");
         break;
       case EasyDeviceMod.DEVICE_TYPE_PHABLET:
         System.out.println("phablet");
         break;
       case EasyDeviceMod.DEVICE_TYPE_TABLET:
         System.out.println("tablet");
         break;
       case EasyDeviceMod.DEVICE_TYPE_TV:
         System.out.println("tv");
         break;
     }

    where constants available are

    • EasyDeviceMod.DEVICE_TYPE_WATCH
    • EasyDeviceMod.DEVICE_TYPE_PHONE
    • EasyDeviceMod.DEVICE_TYPE_PHABLET
    • EasyDeviceMod.DEVICE_TYPE_TABLET
    • EasyDeviceMod.DEVICE_TYPE_TV
  • To get phone type

    int phone_type = easyDeviceMod.getPhoneType();

    Then match it against the constants provided

    switch (phone_type) {
        case EasyDeviceMod.PHONE_TYPE_CDMA:
          System.out.println("Phone Type : CDMA");
          break;
        case EasyDeviceMod.PHONE_TYPE_GSM:
          System.out.println("Phone Type : GSM");
          break;
        case EasyDeviceMod.PHONE_TYPE_NONE:
          System.out.println("Phone Type : None");
          break;
        default:
          System.out.println("Phone Type : Unknown");
          break;
      }

    where constants available are

    • EasyDeviceMod.PHONE_TYPE_CDMA
    • EasyDeviceMod.PHONE_TYPE_GSM
    • EasyDeviceMod.PHONE_TYPE_NONE
  • To get device orientation

    int device_orientation = easyDeviceMod.getOrientation(activity)

    Then match it against the constants provided

switch (device_orientation) { case EasyDeviceMod.ORIENTATION_LANDSCAPE: System.out.println("Orientation : Landscape"); break; case EasyDeviceMod.ORIENTATION_PORTRAIT: System.out.println("Orientation : Portrait"); break; case EasyDeviceMod.ORIENTATION_UNKNOWN: System.out.println("Orientation : Unknown"); break; default: System.out.println("Orientation : Unknown"); break; }


where constants available are 
  + `EasyDeviceMod.ORIENTATION_LANDSCAPE`
  + `EasyDeviceMod.ORIENTATION_PORTRAIT`
  + `EasyDeviceMod.ORIENTATION_UNKNOWN`
  
#### **EasyDisplayMod** 
```java
EasyDisplayMod easyDisplayMod = new EasyDisplayMod(context);
Value functionName returns
Display Resolution getResolution() String
Screen Density getDensity() String
Display XY Coordinate getDisplayXYCoordinates(motionevent) int[]

EasySimMod

EasySimMod easySimMod = new EasySimMod(context);
Value functionName returns
IMSI getIMSI() String
SIM Serial Number getSIMSerial() String
Country getCountry() String
Carrier getCarrier() String

EasyLocationMod

 EasyLocationMod easyLocationMod = new EasyLocationMod(context);
  • To get Latitude-Longitude (Geo)

    //Get Lat-Long
    double[] l = easyLocationMod.getLatLong();
    String lat = String.valueOf(l[0]);
    String lon = String.valueOf(l[1]);
    • Include the one of the required permission in your AndroidManifest.xml
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

    Or

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

EasyDeviceInfo

EasyDeviceInfo easyDeviceInfo = new EasyDeviceInfo(context);
Value functionName returns
Library version getLibraryVersion() String
Clone this wiki locally