- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {OutputStreamWriter o =
OutputStream out;new OutputStreamWriter(out)
OutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
HttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
- Smart code suggestions by Codota
}
private void initUniversalImageLoader() { DisplayImageOptions options = new DisplayImageOptions.Builder() .showImageOnLoading(new ColorDrawable(Color.parseColor("#f0f0f0"))) .resetViewBeforeLoading(true) .cacheInMemory(true) .cacheOnDisk(true) .considerExifParams(true) .imageScaleType(ImageScaleType.EXACTLY_STRETCHED) .bitmapConfig(Bitmap.Config.RGB_565) .build(); int memClass = ((ActivityManager) getSystemService(Context.ACTIVITY_SERVICE)) .getMemoryClass(); int memCacheSize = 1024 * 1024 * memClass / 8; File cacheDir = new File(Environment.getExternalStorageDirectory().getPath() + "/jiecao/cache"); ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this) .threadPoolSize(3) .threadPriority(Thread.NORM_PRIORITY - 2) .denyCacheImageMultipleSizesInMemory() .diskCacheFileNameGenerator(new Md5FileNameGenerator()) .memoryCache(new UsingFreqLimitedMemoryCache(memCacheSize)) .memoryCacheSize(memCacheSize) .diskCacheSize(50 * 1024 * 1024) .tasksProcessingOrder(QueueProcessingType.LIFO) .diskCache(new UnlimitedDiskCache(cacheDir)) .imageDownloader(new BaseImageDownloader(this, 5 * 1000, 30 * 1000)) .defaultDisplayImageOptions(options) .build(); ImageLoader.getInstance().init(config); }
.memoryCache(new UsingFreqLimitedMemoryCache(1 * 1024 * 1024))
.memoryCache(new UsingFreqLimitedMemoryCache(2 * 1024 * 1024)) // 你可以通过自己的内存缓存实现