Example usage for android.content Context getResources

List of usage examples for android.content Context getResources

Introduction

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

Prototype

public abstract Resources getResources();

Source Link

Document

Returns a Resources instance for the application's package.

Usage

From source file:Main.java

public static Integer getEmoticonResId(String emojiUnicode, Context c) {
    return c.getResources().getIdentifier("emoji_" + emojiUnicode, "drawable", c.getPackageName());
}

From source file:Main.java

public static int deviceDPI(Context c) {
    return c.getResources().getDisplayMetrics().densityDpi;
}

From source file:Main.java

public static int getDisplayHeight(Context context) {
    return context.getResources().getDisplayMetrics().heightPixels;
}

From source file:Main.java

public static int getHeightScreen(Context context) {
    return context.getResources().getDisplayMetrics().heightPixels;
}

From source file:Main.java

public static int getWidthScreen(Context context) {
    return context.getResources().getDisplayMetrics().widthPixels;
}

From source file:Main.java

public static float getDeviceDensity(Context context) {
    return context.getResources().getDisplayMetrics().density;
}

From source file:Main.java

public static int getScreenHeighthDp(Context context) {
    return context.getResources().getConfiguration().screenHeightDp;
}

From source file:Main.java

public static final int getWidthInPx(Context context) {
    return context.getResources().getDisplayMetrics().widthPixels;
}

From source file:Main.java

public static float density(Context context) {
    return context.getResources().getDisplayMetrics().density;
}

From source file:Main.java

public static String getMyCountry(Context context) {
    return context.getResources().getConfiguration().locale.getLanguage();
}