Example usage for android.content Context getContentResolver

List of usage examples for android.content Context getContentResolver

Introduction

In this page you can find the example usage for android.content Context getContentResolver.

Prototype

public abstract ContentResolver getContentResolver();

Source Link

Document

Return a ContentResolver instance for your application's package.

Usage

From source file:Main.java

public static String GetDeviceID(Context context) {
    String vResult = Settings.Secure.getString(context.getContentResolver(),
            android.provider.Settings.Secure.ANDROID_ID);
    return vResult;
}

From source file:Main.java

public static String getDeviceId(Context pContext) {
    return Settings.Secure.getString(pContext.getContentResolver(), Settings.Secure.ANDROID_ID);
}

From source file:Main.java

public static String getSN(Context mContext) {
    return android.provider.Settings.System.getString(mContext.getContentResolver(), "android_id");
}

From source file:Main.java

public static boolean isAirplaneMode(Context context) {
    int isAirplaneMode = Settings.System.getInt(context.getContentResolver(), Settings.System.AIRPLANE_MODE_ON,
            0);/*from   www  .j a  va2 s .c  o m*/
    return (isAirplaneMode == 1) ? true : false;
}

From source file:Main.java

public static void saveScreenBrightness(int paramInt, Context context) {
    try {/*  ww w . j a va2  s  .c o  m*/
        Settings.System.putInt(context.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, paramInt);
    } catch (Exception localException) {
        localException.printStackTrace();
    }
}

From source file:Main.java

public static String getUniqueDeviceId(Context context) {
    return android.provider.Settings.Secure.getString(context.getContentResolver(),
            android.provider.Settings.Secure.ANDROID_ID);
}

From source file:Main.java

private static String androidID(Context context) {
    String androidIDStr = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
    return androidIDStr;
}

From source file:Main.java

@SuppressLint("all")
public static String getDeviceId(Context context) {
    return Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
}

From source file:Main.java

public static String getAndroidId(Context ctx) {
    String androidId = Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.ANDROID_ID);
    if (androidId == null || androidId.equalsIgnoreCase("android_id")
            || androidId.equalsIgnoreCase("9774d56d682e549c")) {
        return null;
    }//from  ww w  .  j a  v a2  s  .  c  o  m
    return androidId;
}

From source file:Main.java

public static void setScreenMode(int paramInt, Context mContext) {
    try {//  w  w  w  . j a  v  a2 s  .co  m
        Settings.System.putInt(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, paramInt);
    } catch (Exception e) {
        e.printStackTrace();
    }
}