Back to project page SandB-Android.
The source code is released under:
GNU General Public License
If you think the Android project SandB-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package edu.grinnell.sandb; /* w w w .j a v a 2 s .c o m*/ import android.annotation.TargetApi; import android.app.Application; import android.os.AsyncTask; import android.os.Build; import com.nostra13.universalimageloader.cache.memory.impl.LruMemoryCache; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; public class ScarletAndBlackApplication extends Application { @TargetApi(11) @Override public void onCreate() { super.onCreate(); // Create global configuration and initialize ImageLoader with this configuration ImageLoaderConfiguration.Builder configb = new ImageLoaderConfiguration.Builder(this) .denyCacheImageMultipleSizesInMemory() .memoryCache(new LruMemoryCache(2 * 1024 * 1024)) .memoryCacheSize(6 * 1024 * 1024) .discCacheSize(100 * 1024 * 1024) .discCacheFileCount(100); // .enableLogging(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { configb = configb.taskExecutor(AsyncTask.THREAD_POOL_EXECUTOR) .taskExecutorForCachedImages(AsyncTask.THREAD_POOL_EXECUTOR); } ImageLoader.getInstance().init(configb.build()); } }