• Stars
    star
    99
  • Rank 343,315 (Top 7 %)
  • Language
    Java
  • License
    Other
  • Created about 12 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Remote image loader with caching for Android

Shutterbug - Remote image loader with caching for Android

Shutterbug is an Android library that lets you fetch remote images and cache them. It is particularly suited for displaying remote images in lists or grids as it includes a convenience subclass of ImageView (FetchableImageView) that make implementation a one-liner.

A dual memory and disk cache was implemented. It makes use of two backports of Android classes: LruCache for the memory part and DiskLruCache for the disk part. LruCache was introduced by API Level 12, but we provide it here as a standalone class so you can use the library under lower level APIs. Both LruCache and DiskLruCache are licensed under the Apache Software License, 2.0.

Shutterbug was inspired by SDWebImage which does the same thing on iOS. It uses the same structure and interface. People who are familiar with SDWebImage on iOS will feel at home with Shutterbug on Android.

How to use

First, ensure that the following permissions were added to your AndroidManifest.xml file:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Then, you just have to add the jar or the library project to your project.

Basic usage

You only need a context, an url and an ImageView:

ShutterbugManager.getSharedImageManager(context).download(url, imageView);

Using FetchableImageView

  1. Instantiate the subclass (either in your code or in an xml file, for example by replacing ImageView by com.applidium.shutterbug.FetchableImageView).
  2. Fetch the image (setImage(String url) or setImage(String url, Drawable placeholderDrawable) if you need to add a placeholder while waiting for the image to be fetched)
  3. That's it!

We also provide you with a listener interface (FetchableImageViewListener) which will help you refresh your UI if need.

Using ShutterbugManager

If you need to do more advanced coding, you can use ShutterbugManager. It is a singleton class whose instance is accessed by the static method ShutterbugManager.getSharedManager(context). Downloading and caching is done by calling download(String url, ShutterbugManagerListener listener) on this instance.

More Repositories

1

ADTransitionController

UINavigationController with custom transitions
Objective-C
1,188
star
2

OverlayContainer

Non-intrusive iOS UI library to implement overlay based interfaces
Swift
1,149
star
3

ADLivelyTableView

Lively UITableView
Objective-C
743
star
4

ADClusterMapView

MKMapView with clustering
Objective-C
658
star
5

Cracking-Siri

Files we used to reverse-engineer Siri
Ruby
575
star
6

Vim

Port of the Vim text editor to the iOS
C
533
star
7

PokemonGo_Android_RE

Java
511
star
8

ADLivelyCollectionView

Drop-in subclass of UICollectionView that lets you add custom animations to any UICollectionView
Objective-C
432
star
9

HeaderListView

Android ListView with sticky headers
Java
313
star
10

AudioModem

Transfer data using microphone/speaker on iOS devices
Objective-C
196
star
11

ADZipURLProtocol

Open static website or access data from a zip archive
C
52
star
12

CandyCrushSolver

This is an Android project that helps you solve the game Candy Crush.
Java
47
star
13

zizou

Elo ranking managed through the messaging software Slack
Ruby
13
star
14

D3Android

D3Android is a new library to make charts on Android
Java
12
star
15

bike-share-prediction

Bike-share usage prediction API
Ruby
10
star
16

clarke

Ruby
8
star
17

Apex

An awesome visualization of what's hot on Apple's App Store
JavaScript
4
star
18

clarke-messenger

Ruby
2
star
19

cyril

Bot pairing Slack users connected to the general channel
Ruby
2
star
20

regex_field

Regex field for Rails FormHelper
JavaScript
1
star
21

spec_tracker

Spec tracker helps tracking tests that validate specification use cases
Ruby
1
star
22

clarke-slack

Ruby
1
star
23

gradle-dependencies-demo

1
star
24

adfastlane-gem

Fastlane wrapper to allow usage of distant Gemfile. Applidium internal usage
Ruby
1
star