use of android.support.annotation.WorkerThread in project quran_android by quran.
the class QuranUtils method getDebugInfo.
@WorkerThread
public static String getDebugInfo(Context context, QuranScreenInfo quranScreenInfo) {
StringBuilder builder = new StringBuilder();
builder.append("Android SDK Version: ").append(Build.VERSION.SDK_INT);
String location = QuranSettings.getInstance(context).getAppCustomLocation();
builder.append("\nApp Location:").append(location);
try {
File file = new File(location);
builder.append("\n App Location Directory ").append(file.exists() ? "exists" : "doesn't exist").append("\n Image zip files:");
String[] list = file.list();
for (String fileName : list) {
if (fileName.contains("images_")) {
File f = new File(fileName);
builder.append("\n file: ").append(fileName).append("\tlength: ").append(f.length());
}
}
} catch (Exception e) {
builder.append("Exception trying to list files").append(e);
}
if (quranScreenInfo != null) {
builder.append("\nDisplay: ").append(quranScreenInfo.getWidthParam());
if (quranScreenInfo.isDualPageMode()) {
builder.append(", tablet width: ").append(quranScreenInfo.getWidthParam());
}
builder.append("\n");
}
int memClass = ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE)).getMemoryClass();
builder.append("memory class: ").append(memClass).append("\n\n");
return builder.toString();
}
use of android.support.annotation.WorkerThread in project vlc-android by GeoffreyMetais.
the class ThumbnailsProvider method getComposedImage.
@WorkerThread
public static Bitmap getComposedImage(MediaGroup group) {
final BitmapCache bmc = BitmapCache.getInstance();
final String key = "group:" + group.getTitle();
Bitmap composedImage = bmc.getBitmapFromMemCache(key);
if (composedImage == null) {
composedImage = composeImage(group);
if (composedImage != null)
bmc.addBitmapToMemCache(key, composedImage);
}
return composedImage;
}
use of android.support.annotation.WorkerThread in project vlc-android by GeoffreyMetais.
the class AudioUtil method prepareCacheFolder.
@SuppressLint("NewApi")
@WorkerThread
public static void prepareCacheFolder(final Context context) {
try {
if (AndroidDevices.hasExternalStorage() && context.getExternalCacheDir() != null)
CACHE_DIR = context.getExternalCacheDir().getPath();
else
CACHE_DIR = AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY + "/Android/data/" + BuildConfig.APPLICATION_ID + "/cache";
} catch (Exception | ExceptionInInitializerError e) {
// catch NPE thrown by getExternalCacheDir()
CACHE_DIR = AndroidDevices.EXTERNAL_PUBLIC_DIRECTORY + "/Android/data/" + BuildConfig.APPLICATION_ID + "/cache";
}
ART_DIR.set(CACHE_DIR + "/art/");
COVER_DIR.set(CACHE_DIR + "/covers/");
for (String path : Arrays.asList(ART_DIR.get(), COVER_DIR.get())) {
File file = new File(path);
if (!file.exists())
file.mkdirs();
}
}
use of android.support.annotation.WorkerThread in project VirtualAPK by didi.
the class LoadedPlugin method createResources.
@WorkerThread
private static Resources createResources(Context context, File apk) {
if (Constants.COMBINE_RESOURCES) {
Resources resources = ResourcesManager.createResources(context, apk.getAbsolutePath());
ResourcesManager.hookResources(context, resources);
return resources;
} else {
Resources hostResources = context.getResources();
AssetManager assetManager = createAssetManager(context, apk);
return new Resources(assetManager, hostResources.getDisplayMetrics(), hostResources.getConfiguration());
}
}
use of android.support.annotation.WorkerThread in project Walrus by megabug.
the class ReadCardDataFragment method onFinish.
@Override
@WorkerThread
public void onFinish() {
FragmentManager fragmentManager = getFragmentManager();
Fragment dialogFragment = fragmentManager.findFragmentByTag(SINGLE_CARD_DATA_IO_DIALOG_FRAGMENT_TAG);
if (dialogFragment != null)
fragmentManager.beginTransaction().remove(dialogFragment).commit();
}
Aggregations