Android Open Source - image-loader Demo Application






From Project

Back to project page image-loader.

License

The source code is released under:

Apache License

If you think the Android project image-loader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.novoda.imageloader.demo;
//from  w w  w. ja  va 2 s. c  o  m
import android.app.Application;

import com.novoda.imageloader.core.ImageManager;
import com.novoda.imageloader.core.LoaderSettings;
import com.novoda.imageloader.core.LoaderSettings.SettingsBuilder;
import com.novoda.imageloader.core.cache.LruBitmapCache;

public class DemoApplication extends Application {

    /**
     * It is possible to keep a static reference across the
     * application of the image loader.
     */
    private static ImageManager imageManager;

    @Override
    public void onCreate() {
        super.onCreate();
        normalImageManagerSettings();
    }

    /**
     * Normal image manager settings
     */
    private void normalImageManagerSettings() {
        imageManager = new ImageManager(this, new SettingsBuilder()
                .withCacheManager(new LruBitmapCache(this))
                .build(this));
    }

    /**
     * There are different settings that you can use to customize
     * the usage of the image loader for your application.
     */
    @SuppressWarnings("unused")
    private void verboseImageManagerSettings() {
        SettingsBuilder settingsBuilder = new SettingsBuilder();

        //You can force the urlConnection to disconnect after every call.
        settingsBuilder.withDisconnectOnEveryCall(true);

        //We have different types of cache, check cache package for more info
        settingsBuilder.withCacheManager(new LruBitmapCache(this));

        //You can set a specific read timeout
        settingsBuilder.withReadTimeout(30000);

        //You can set a specific connection timeout
        settingsBuilder.withConnectionTimeout(30000);

        //You can disable the multi-threading ability to download image 
        settingsBuilder.withAsyncTasks(false);

        //You can set a specific directory for caching files on the sdcard
        //settingsBuilder.withCacheDir(new File("/something"));

        //Setting this to false means that file cache will use the url without the query part
        //for the generation of the hashname
        settingsBuilder.withEnableQueryInHashGeneration(false);

        LoaderSettings loaderSettings = settingsBuilder.build(this);
        imageManager = new ImageManager(this, loaderSettings);
    }

    /**
     * Convenient method of access the imageLoader
     */
    public static ImageManager getImageLoader() {
        return imageManager;
    }

}




Java Source Code List

com.novoda.imageloader.acceptance.BitmapUtilsInstrumentationTest.java
com.novoda.imageloader.acceptance.BitmapUtilsShould.java
com.novoda.imageloader.acceptance.ImageLoaderDemoActivityTest.java
com.novoda.imageloader.acceptance.ImageManagerInstrumentationTest.java
com.novoda.imageloader.acceptance.LruBitmapCacheInstrumentationTest.java
com.novoda.imageloader.core.ImageManager.java
com.novoda.imageloader.core.LoaderContext.java
com.novoda.imageloader.core.LoaderSettings.java
com.novoda.imageloader.core.OnImageLoadedListener.java
com.novoda.imageloader.core.bitmap.BitmapUtil.java
com.novoda.imageloader.core.cache.CacheManager.java
com.novoda.imageloader.core.cache.LruBitmapCache.java
com.novoda.imageloader.core.cache.NoCache.java
com.novoda.imageloader.core.cache.SoftMapCache.java
com.novoda.imageloader.core.cache.util.LruCache.java
com.novoda.imageloader.core.exception.ImageCopyException.java
com.novoda.imageloader.core.exception.ImageNotFoundException.java
com.novoda.imageloader.core.exception.MissingSettingException.java
com.novoda.imageloader.core.file.BasicFileManager.java
com.novoda.imageloader.core.file.FileManager.java
com.novoda.imageloader.core.file.util.AndroidFileContext.java
com.novoda.imageloader.core.file.util.FileUtil.java
com.novoda.imageloader.core.file.util.FlushedInputStream.java
com.novoda.imageloader.core.loader.ConcurrentLoader.java
com.novoda.imageloader.core.loader.Loader.java
com.novoda.imageloader.core.loader.SimpleLoader.java
com.novoda.imageloader.core.loader.util.AsyncResult.java
com.novoda.imageloader.core.loader.util.AsyncTask.java
com.novoda.imageloader.core.loader.util.BitmapDisplayer.java
com.novoda.imageloader.core.loader.util.BitmapRetriever.java
com.novoda.imageloader.core.loader.util.LoaderTask.java
com.novoda.imageloader.core.loader.util.SingleThreadedLoader.java
com.novoda.imageloader.core.model.ImageTagFactory.java
com.novoda.imageloader.core.model.ImageTag.java
com.novoda.imageloader.core.model.ImageWrapper.java
com.novoda.imageloader.core.network.NetworkManager.java
com.novoda.imageloader.core.network.UrlNetworkManager.java
com.novoda.imageloader.core.network.UrlUtil.java
com.novoda.imageloader.core.util.AnimationHelper.java
com.novoda.imageloader.core.util.DirectLoader.java
com.novoda.imageloader.core.util.Log.java
com.novoda.imageloader.demo.DemoApplication.java
com.novoda.imageloader.demo.activity.BigImages.java
com.novoda.imageloader.demo.activity.Demos.java
com.novoda.imageloader.demo.activity.DirectLoading.java
com.novoda.imageloader.demo.activity.ImageLongList.java
com.novoda.imageloader.demo.activity.LongSmallImageList.java
com.novoda.imageloader.demo.activity.base.ImageLoaderBaseActivity.java
com.novoda.imageloader.demo.provider.CustomUriMatcher.java
com.novoda.imageloader.demo.provider.DatabaseManager.java
com.novoda.imageloader.demo.provider.ImageLoaderDemoProvider.java
com.novoda.imageloader.demo.provider.SqlFile.java
com.novoda.imageloader.demo.util.BugSenseHelper.java
com.novoda.imageloader.demo.util.BugsenseApiKeyFailedException.java