List of usage examples for android.content Context getApplicationContext
public abstract Context getApplicationContext();
From source file:Main.java
public static boolean cleanInternalDbByName(Context context, String dbName) { return context.getApplicationContext().deleteDatabase(dbName); }
From source file:Main.java
/** * Get application package name/* w w w .j ava 2s .c o m*/ * * @return package name */ public static String getPackageName(Context ctx) { return ctx.getApplicationContext().getPackageName(); }
From source file:Main.java
public static String getPackageName(Context context) { String PACKAGE_NAME = context.getApplicationContext().getPackageName(); return PACKAGE_NAME; }
From source file:Main.java
public static File getBaseDirectoryPath(Context context) { File cacheDir = context.getApplicationContext().getExternalCacheDir(); if (cacheDir == null) cacheDir = context.getApplicationContext().getCacheDir(); return cacheDir; }
From source file:Main.java
public static int getScreenHeight(Context context) { DisplayMetrics dm = context.getApplicationContext().getResources().getDisplayMetrics(); return dm.heightPixels; }
From source file:Main.java
public static float getDensity(Context context) { DisplayMetrics dm = context.getApplicationContext().getResources().getDisplayMetrics(); return dm.density; }
From source file:Main.java
public static int getScreenWidth(Context context) { DisplayMetrics dm = context.getApplicationContext().getResources().getDisplayMetrics(); return dm.widthPixels; }
From source file:Main.java
public static String getAppPackageName(Context context) { Context applicationText = context.getApplicationContext(); return applicationText.getPackageName(); }
From source file:Main.java
private static AudioManager getAudioManager(Context context) { return (AudioManager) context.getApplicationContext().getSystemService(Context.AUDIO_SERVICE); }
From source file:Main.java
public static void initialize(Context context) { sContext = context.getApplicationContext(); }