Coder Social home page Coder Social logo

morristech / imagegrabber Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aznslayer/imagegrabber

0.0 0.0 0.0 464 KB

Android image grabber/fetcher library with automatic resizing and memory, disk, and http caching.

License: Other

HTML 73.65% Java 26.35%

imagegrabber's Introduction

ImageGrabber

The ImageGrabber library provides a utility to automatically download and cache images from the web. This library uses memory and disk caching efficiently and provide users with the option to force a network response from the web to query for updates even when the image is cached.

Download: JAR library

Usage

When using this library, simply add the JAR to your project:

Right click on project --> Properties --> Java Build Path --> Libraries --> Add External JARs

Example

ImageView imageView = ...
String imageUrl = ...

// Setting the image cache directory and cache size
ImageCacheParams cacheParams = new ImageCacheParams("thumbs");
cacheParams.memCacheSize = 1024 * 1024 * Utils.getMemoryClass(getApplicationContext()) / 3;

// Initializing an ImageGrabber object with 100 as the image width and height
ImageGrabber imageGrabber = new ImageGrabber(getApplicationContext(), 100);

// Setting a placeholder image when image is loading
imageGrabber.setLoadingImage(R.drawable.loading_image);

// Setting an image cache for the utility
ImageCache imageCache = new ImageCache(getApplicationContext(), cacheParams);
imageGrabber.setImageCache(mImageCache);

// Forcing a network response from server to check for updates even when image is cached
imageGrabber.setAlwaysFetchFromServer(true);

// Loading the image from any given URL
imageGrabber.loadImage(imageUrl, imageView);

To Do

  • Add functionality for local files as well

License

Acknowledgements

This library consists of code mostly from the Android Open Source Project.

imagegrabber's People

Contributors

aznslayer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.