Brain Flush

November 23, 2009

Droid-Fu, Part 2: WebImageView and WebGalleryAdapter

Filed under: Software Development & Programming — Tags: , — Matthias @ 11:19 pm

This is the second in a series of posts about Droid-Fu, a shiny new shared library for Android application developers. In this post I will introduce two very handy components: WebImageView and WebGalleryAdapter.

WebImageView: Buy one, get two!

Many mobile apps make heavy use of web based content, especially photos, avatars, and other images. The problem with that is: you have to download the images before being able to display them, which has basically three important implications:

  1. the download has to be asynchronous, otherwise your UI will lock up
  2. while the download is processing, you have to keep the user happy by displaying some kind of progress indicator
  3. downloading stuff means you’re sucking away on your user’s quota, hence, you typically want to cache downloaded images.

That sounds like an awful lot of stuff to care about for achieving a rather underwhelming effect: displaying an image. Fortunately, there is a dead simple way to get all this in one handy small package: Droid-Fu’s WebImageView.

Here is an example of what it can look like. The first screenshot shows WebImageView in its loading state, using a grey solid background (of course you can change that) and the stock progress spinner (you can change that, too). The second screenshot shows the fully loaded image.

 

Using WebImageView

If you haven’t already downloaded and linked the Droid-Fu JAR to your project, do that now. Then, in your layout, add this:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:droidfu="http://github.com/droidfu/schema"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center"
    android:background="#FFF"
    >

  <com.github.droidfu.widgets.WebImageView android:id="@+id/webimage"
      android:layout_width="75dip"
      android:layout_height="75dip"
      android:background="#CCC"
      droidfu:autoLoad="true"
      droidfu:imageUrl="http://www.android.com/images/opensourceprojec.gif"
      droidfu:progressDrawable="..."
      />

</LinearLayout>

All arguments are optional, this allows you to define your view first, and then trigger loading the image programatically using WebImageView.loadImage(). Easy, huh?

Caching

WebImageView is backed by ImageLoader, Droid-Fu’s generic way of fetching images from the web. ImageLoader itself is backed by a two-level cache. When you load an image using WebImageView (or ImageLoader), what happens is that the 1st-level (in-memory) cache is queried for the required bitmap. If it’s a hit, it’s served immediately. If it’s a miss, the request drops through to the 2nd-level cache, which is the disk cache. Droid-Fu uses your app’s cache directory, which is managed by Android, so you don’t have to worry about maintenance stuff. If this request also misses, then WebImageView will finally go ahead and download the image from the web.

Be careful not to set the cache size too big. Cache size is currently defined in terms of “number of images” instead of “number of bytes”, so if you know you’re gonna download large high-res images, set this to a small value, otherwise you’ll see OutOfMemory errors. Forget that last paragraph. Meanwhile, I have changed the in-memory cache implementation. It’s now a weak-reference backed hash created by the Google Collections MapMaker, the capacity of which will automatically scale with the available memory. Simply put, if there’s not enough memory left, any cache entry will be garbage collected, unless there is still a strong reference to it (e.g. because it’s currently displayed to the user).

WebGalleryAdapter

So how else can you make use of this? Well, I don’t know, but I know that I already made use of this when implementing WebGalleryAdapter. This class serves as an adapter for Android’s Gallery widget, and it’s completely plug-and-play: Create your gallery, call setAdapter() with a WebGalleryAdapter instance, and pass it a bunch of image URLs. Whenever the user then scrolls/flings through the images in your gallery, the images will be fetched automatically from the web, with all the features such as caching and progress indication as described before.

About these ads

81 Comments »

  1. Way to go dude, releasing all this stuff :) Go Qype free software fighters :D

    Comment by obvio171 — November 24, 2009 @ 9:49 am

  2. Does this WebImageGallery also work across screen orientation changes? (like your BetterAsyncTask did)

    Comment by hansop — November 30, 2009 @ 12:25 pm

    • Unfortunately no, because ImageLoader doesn’t use AsyncTask, but a simple, static ThreadPoolExecutor to do the downloading. Although I could migrate the code to use BetterAsyncTask, I’m not sure about the performance impact, and the impact on the remaining code base (mainly because image downloads could block further tasks by consuming all threads in the thread pool managed by AsyncTask).

      But you raise a good point, I’ll see if I can come up with a decent solution for this.

      Comment by Matthias Käppler — November 30, 2009 @ 2:02 pm

  3. his is great stuff, thanks for making it available.

    Hey, how do you go about customizing the Gallery? (image dimensions, how many images show up per page…)

    Thanks in advance!

    Comment by adk — January 7, 2010 @ 11:38 pm

    • Since adapter and widget (i.e. Gallery) are decoupled, you would just customize Gallery through the set of view attributes it supports. It’s just yet another Android view. If you need more complicated functionality, you probably want to subclass it.

      Comment by Matthias Käppler — January 8, 2010 @ 9:34 am

  4. Hey, thanks for the super fast response.

    The documentation for the Gallery (http://developer.android.com/reference/android/widget/Gallery.html) says that “Views given to the Gallery should use Gallery.LayoutParams as their layout parameters type.”

    e.g.,
    i.setLayoutParams(new Gallery.LayoutParams(200, 150));

    This is how I was setting the image dimensions, specifically. Since the GalleryViewAdapter creates the ImageViews (actually, WebImageViews), my code no longer has access to them.

    Since most of the awesomeness is in your WebImageView and ImageLoader classes, I am working around this by simply creating my own adapter that uses them.

    But I was wondering if you had any thoughts on how this could be done differently, while still using your WebGalleryAdapter – perhaps adding the option to define the ImageView in a layout file and inflate it inside the WebGalleryAdapter?

    Thanks again!

    Comment by adk — January 8, 2010 @ 4:40 pm

    • Ah now I see what you mean. Sorry. :-) Yes, that’s certainly possible. What you should do is subclass WebGalleryAdapter and override onGetView() (that method is a no-op in the superclass and meant to be implemented by subclasses).

      The documentation for that is still missing, unfortunately, mostly because all this is still subject to change, but what happens atm is this:

      WebGalleryAdapter.getView() creates a container (a FrameLayout) for each WebImageView, and puts the WebImageView inside the container. The container is then passed to onGetView(), where you can customize it (e.g. set a new padding or whatever).

      Not really an ideal solution. Maybe I should move the container creation stuff to be the default implementation of onGetView(), and only pass the WebImageView to onGetView()? That way, subclasses can do with a single WebImageView whatever they see fit.

      Comment by Matthias Käppler — January 8, 2010 @ 4:56 pm

      • Makes sense. I’ll try that.

        Thanks again!

        Comment by adk — January 11, 2010 @ 7:18 pm

      • I was looking at the ArrayAdapter:
        http://developer.android.com/reference/android/widget/ArrayAdapter.html

        The constructor takes a layout id, which it then inflates and uses for each individual list item view.

        Seems like a nice solution for what we were talking about.

        Thanks again for making this code available and taking your time to explain it.

        Comment by adk — January 13, 2010 @ 12:51 am

      • a good idea actually, but if I do that, then WebGalleryAdapter doesn’t really do anything anymore. The idea behind WebGallerAdapter was simply that it manages the creation of WebImageViews for you using the standard getView() method, and if you do all that yourself by managing a completely custom layout, then you can use whatever Adapter you want.

        Comment by Matthias Käppler — January 13, 2010 @ 10:30 am

  5. Just want to say thanks for releasing and explaining this – great application of Droid-Fu. Looking forward to lots more Android dev add-ons that are free in both senses like this.

    Comment by Luke Meyer — January 9, 2010 @ 9:40 pm

  6. WebImageView has saved heeps of trouble.

    I noticed some methods no longer supported though, and wanted to double check they have not been implemented.

    You can not set the downloadable URL to be the background of the ImageView instead of the main image , and also
    setAdjustViewBounds(true);
    setScaleType(ScaleType.CENTER_CROP);

    no longer seem to be supported.

    Just wanted to confirm.

    Comment by Stephen Kilsby — January 19, 2010 @ 4:06 am

    • Ive modified the code to supprt these,was quite trivial to make it support them really

      Comment by Stephen Kilsby — January 19, 2010 @ 5:19 am

      • you mean these methods are deprecated in Android 2.x? What exactly did you change? Just so I can include it in the upcoming release.

        Thanks for reporting!

        Comment by Matthias Käppler — January 19, 2010 @ 9:46 am

      • It was just that the WebImageView is not an ImageView, so that some of the ImageView functions were not accessible. So I’ve just made wrapper functions in WebImageView to call the same functions in ImageView.

        Once I’ve seen its all working I will send the changes through

        Comment by Stephen Kilsby — January 21, 2010 @ 3:46 am

      • I’m having a issue that is related.

        Have you committed this changes already?

        Comment by alaxid — January 20, 2011 @ 1:56 am

      • I did not commit my changes because I ended up making changes that were more specific to my situation… What is your issue?

        Comment by Stephen Kilsby — February 15, 2011 @ 11:10 pm

  7. Found another interesting issue.

    When I was trying to get WebImageView to download images, It started returning

    01-27 00:11:18.110: DEBUG/skia(219): — SkImageDecoder::Factory returned null

    The problem was that in ImageLoader.run()
    After downloading the image giving it to Bitmap.decodeStream(), the bitmap decoder could not create the bitmap.

    I looked around and found someone who made a solution for a similar problem: http://stackoverflow.com/questions/1630258/android-problem-bug-with-threadsafeclientconnmanager-downloading-images

    Just gives a different way of opening the connection to donwload the image resource.

    So in ImageLoader.run()

    instead of using

    URL url = new URL(imageUrl);
    bitmap = BitmapFactory.decodeStream(url.openStream());

    to download and decode the image, I now use

    HttpGet httpRequest = new HttpGet(URI.create(imageUrl) );
    HttpClient httpclient = new DefaultHttpClient();
    HttpResponse response = (HttpResponse) httpclient.execute(httpRequest);
    HttpEntity entity = response.getEntity();
    BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity);
    InputStream instream = bufHttpEntity.getContent();
    bitmap = BitmapFactory.decodeStream(instream);

    This does not cause the error.

    Comment by Stephen Kilsby — January 27, 2010 @ 1:33 am

    • Just found this has fixed it for some of the images I am downloading, but is still apparent for others(the decoding error).

      I will investigate more and get back with what I found

      Comment by Stephen Kilsby — January 27, 2010 @ 1:39 am

      • So it seems this fix does help, the second error I got was becasue the image was not actually able to be decoded(rather than the http call not returning the data properly).

        Comment by Stephen Kilsby — January 27, 2010 @ 1:52 am

    • Just make sure you don’t create a new HttpClient instance for every single download, that’s extremely wasteful. You should keep a single instance across your whole application and have your connections be managed by a ThreadSafeClientConnectionManager.

      Comment by Matthias Käppler — January 27, 2010 @ 9:41 am

  8. I am having a hard time getting transparent images to display correctly in the WebImageView. In some of my activities, the image shows up with a black background, and in some a white background. I poked around the source for the library a bit, but nothing really jumped out at me. Any ideas? Thanks

    Comment by Jason — April 14, 2010 @ 9:32 pm

    • Ok, figured it out. Our problem was that cached images are compressed as JPEG which wipes out the alpha channel. Changing this to compress as PNG fixed our problem (although cached images are now going to be a bit larger).

      Comment by Jason — April 14, 2010 @ 11:58 pm

      • Could you post here how you did it ?
        I cannot find a way to resolve that alpha/transparency issue :(
        Also the .jar cannot be built anymore (missing maps.jar file reported by maven installer).

        How did you manage to perserve the alpha channel ?

        Comment by Myraddin — January 11, 2011 @ 4:45 pm

  9. Hi,

    Is WebImageView component working on emulator? Do I need to deploy app on devices?

    I just installed jar (pre-built version) and tried to display image, but I see only loading animation. Do you know why?

    Comment by Denis — May 6, 2010 @ 6:39 pm

  10. Same issue as Denis … does WebImageView still work? Any special tricks to get it to actually display an image from the web in an Emulator? (image is stuck in the loading animation).

    Thanks in advance,
    Pedro

    Comment by Pedro — May 17, 2010 @ 8:54 am

    • I have to admit that due to time constraints I haven’t been working on the lib lately, but I will get back to it in a couple of weeks. Hold tight.

      Comment by Matthias Käppler — May 17, 2010 @ 6:56 am

  11. I found that WebImageView behaves very interesting in the ListView. First few images are loading into the first list item, but after that everything become normal. Do you know about this issue?

    Comment by Denis — June 10, 2010 @ 5:58 am

  12. where is the source ? …

    Comment by fahad — June 11, 2010 @ 10:16 pm

    • It’s linked several times in the article

      Comment by Matthias Käppler — June 17, 2010 @ 7:15 am

      • But I’m not that familiar to android. can you please update your code with that change?
        So that we can directly change the codes in our file from your files.

        Im still not understanding why it keeps loading if we use less height and width.?
        If give big space i.e. large height and width to load the image then it loads properly..

        Comment by Umakant Patil — October 22, 2010 @ 6:48 am

  13. This is fantastic!

    I have quickly put together a proof using the WebGalleryAdapter, and it runs really well on the emulator locally. When I switch to a real device, using 3G, most of the images never end up loading.

    Can you tell me how the WebGalleryAdapter tries to load images? Does it only load what is needed (e.g. visible on screen).

    Comment by aaron — September 23, 2010 @ 7:56 am

    • The Gallery widget only loads what is required on screen. However, I just saw that the way the WebGalleryAdapter is implemented is not optimal : it does not make use of view recycling (the getView method should use the convertedView parameter correctly, but it does not). Instead, new widgets are created whenever a Gallery item is rendered.

      Comment by David — October 19, 2010 @ 2:47 am

  14. I would just like to add, that by making the change to ImageLoader.java in the method “run”, based on the comments at : http://stackoverflow.com/questions/1630258/android-problem-bug-with-threadsafeclientconnmanager-downloading-images/2099536#2099536

    All images load 100% of the time for me.

    Perhaps a change can be made to the library?

    Comment by aaron — September 27, 2010 @ 4:40 am

  15. Hi..Matthias

    Hats off. This helped and saved my lot of work. I just found a bug in it.
    When I used table and inside table I’m calling webimageview. Now it happens that
    when I set height and width as 75 X 75 using LayoutParams then 12 out of 15 images keeps in loading state
    where as if I use 80 x 80 then 5 out of 15 of the images are still in loading state.
    I have images in different dimensions. How can this be correct as my UI is in such a way that i need to use 75 X 75 only.
    If you want my code to over for debugging then you can find me email id in this comment. I will reply to it with the code.

    Thanks ;)

    Comment by Umakant Patil — October 21, 2010 @ 1:46 pm

  16. Great lib!

    i’m using WebImageView.
    I would like to know if there is a way to show the progress icon over the loaded image, not in black(or color) background.

    i think it would be great to add a callback function to catch the event on loaded image, to perform some actions before.

    Hope you can implement this functionalities.

    Comment by Mc — October 26, 2010 @ 7:52 am

  17. Hi, this works great!

    How do you cancel/abort an image load? I’m trying to use this on a ListView. I was calling reset(), and setImageUrl() to change the loaded image when I reuse a view. It works but you get a glimpse of the old images it tried to load. And sometimes it ends up with the wrong image. I was hoping for something like a cancelImageLoad() method. Or is that already in there? I couldn’t find it though.

    Thanks!

    Comment by Shiki — November 3, 2010 @ 9:58 am

  18. When the changes

    setAdjustViewBounds(true);
    setScaleType(ScaleType.CENTER_CROP);

    will be applied? I started using the WebImageView but I have problems trying to scale down my image to fit in the screen and keep the aspect ratio in order to not get any distortion. I saw a comment from Stephen Kilsby on January 19, 2011 say that he implemented the changes and was going to submit to you to incorporate the code. Has it been done? I downloaded the jar file from the github website and it seems that it still does not support the changes.

    Thanks
    T

    Comment by Thiago — November 5, 2010 @ 11:29 am

  19. I am still getting black background on transparent images. I downloaded the latest version from the website. What can I do to solve this problem. I saw your post where you convert from jpeg to png, but did you commit that do the git repository? does the jar file contain this change?

    Thanks

    Comment by Thiago — November 17, 2010 @ 9:21 pm

    • that JAR file is ages old, you should always pull from the master branch. It contains that fix since a few weeks.

      Comment by Matthias Käppler — November 17, 2010 @ 11:15 pm

  20. Yup, cannot get over the alpha/transparency issue, and cannot build the .jar file neither :(

    Any tips ?

    Comment by Myraddin — January 11, 2011 @ 4:47 pm

  21. When I managed to build the droid-fu source (took maps.jar from the android SDK) ,the in-memory cache was working but the file cache wasn’t.

    So the alpha/transparency & background issue was gone but caching works only partially :(

    Comment by Myraddin — January 12, 2011 @ 8:11 am

    • Got it resolved.

      the new droid-fu requires: for file cache to work.
      Strange because this wasn’t necessary before :)

      Comment by Myraddin — January 12, 2011 @ 8:34 am

      • <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” />

        Comment by Myraddin — January 12, 2011 @ 8:35 am

  22. would you mind building another new version with all of these changes and upload to the github website? I am having a hard time here to generate the jar file. Since you have everything set up it would be easier for you to create this file for us. Thanks, T.

    Comment by Thiago — January 12, 2011 @ 10:42 am

  23. http://stackoverflow.com/questions/4634707/droid-fu-on-cache-hit-shows-the-setnoimagedrawable-drawable

    Has anyone also had this issue?
    Basically I have the downloaded image correctly loaded in my list and then when I hit in that item I open an activity where it displays the same downlodaded image.
    At the first time there is a cache hit and it shows the image correctly.
    Then if I hit back and go straight into the same item activity it won’t show the downloaded (and cached) image but instead it will show the drawable set by setnoimagedrawable.

    It is kinda awkward..

    Comment by Alaxid — January 16, 2011 @ 6:59 pm

  24. I am not able to build droid-fu from source and I think the JAR available on github is a bit old. Had posted here: http://stackoverflow.com/questions/5024121/droid-fu-build-error.
    Can I get the JAR from somewhere?

    Comment by Abhinav — February 22, 2011 @ 7:31 am

  25. I’m curious on how I can force a BetterAsyncTask to stop. I want the download I’m doing to continue even if the app is hidden by the phone or anything, but I want the task to end once I’ve got the data downloaded and I can’t figure out how to do that. I set all references to it to null but the debugger says that the task continues to run. Then, if I exit and reload the app it will start a new download task (which is what I want), get my information and then continue to run, but now I’ll have three tasks running! I can see how this will start to hog up resources and I don’t want that!

    Comment by Tom — February 24, 2011 @ 7:54 am

    • You cannot force a task to stop, but you can ask it to by calling cancel(). The task will probably continue running, but will not call back to onPostExecute when doInBackground returns. You can also pass ‘true’ to cancel, which sends a interrupt, but correct me if I’m wrong, I believe this has only an effect on threads that are wait()-ing. Of course you can always implement your worker methods to perform work in small chunks inside a loop, and check on every iteration whether a cancel() has been requested and gracefully exit if so.

      Comment by Matthias Käppler — February 24, 2011 @ 10:33 am

      • I’ve been trying to figure out what to call to have it “gracefully” exit. I can only seem to find ways to cancel the thread and methods to check if it has been cancelled, but nothing about how to have the thread stop.

        Comment by Tom — February 24, 2011 @ 6:32 pm

      • Force-stopping threads is not possible in Java. They stop when their run() method returns.

        Comment by Matthias Käppler — May 16, 2011 @ 8:55 am

  26. I’ve managed to make the webimageview not reload or re-render in a gridview as it scrolls by using the following in my adapter:

    if ( view.isLoaded() == false)
    view.loadImage();

    However, with view recycling: when I scroll my gridview the position is constantly being reset for each view. Do you have any suggestions for using webimageview in a gridview w/ recycling views that maintain position?

    Right now I’m recycling by:
    if convertview not null then
    view = (WebImageView) convertView;
    view.setImageUrl(url);
    load view

    PS > Droidfu is awesome. Thanks a lot :)

    Comment by Evan — May 8, 2011 @ 6:53 pm

    • It would be great if anyone has a working example of using ImageLoaderHandler to cache webimageviews.

      Comment by Evan — May 8, 2011 @ 8:17 pm

      • WebImageView caches images by default. It uses ImageLoader, which in turn uses ImageCache.

        Comment by Matthias Käppler — May 16, 2011 @ 8:53 am

  27. Is there a way to limit the size of the cache?

    Comment by Josh — May 12, 2011 @ 9:33 am

    • not possible at the moment. Would be easy enough to add for the in-memory cache, but the persistent storage is always a little more difficult to handle. patches welcome though :-)

      Comment by Matthias Käppler — May 16, 2011 @ 8:51 am

  28. My kingdom for some sample code (full project). Cannot get this to work for the life of me.

    Comment by Sydney — May 16, 2011 @ 2:14 am

    • I hear you, sorry for that, I never got around to set one up. Putting this on my ever growing todo list. Meanwhile, what exactly are you struggling with?

      Comment by Matthias Käppler — May 16, 2011 @ 8:48 am

  29. Thanks for the great WebImageView. Very very useful.

    Comment by dharmin007 — June 2, 2011 @ 6:24 pm

  30. Hi, I tried to use the webimageview inside a listview item. I have handled the listViewSelectionChanged event to display the image in the webimageview into a large webimageview outside the listview. But when I do so the app’s response becomes very slow. And when I remove the onSelectionChanged event it performs good. Any ideas on where the problem might be?

    Comment by dharmin007 — June 16, 2011 @ 4:57 pm

  31. I have animated gif-file and trying to display it using WebImageView, but I see static image and can’t see animation :( Is WebImageView supports loadeed gif-animated files?
    Thanks.

    Comment by Игорь — July 1, 2011 @ 9:35 am

    • Android 2.1 doesnt play gif animated image.

      Comment by Umakant — July 1, 2011 @ 10:28 am

      • I have 2.2.1 installed on my device

        Comment by Igor — July 1, 2011 @ 11:35 am

  32. Great work! This worked on my first try, it was easy to get up and running.

    I’m using this in a ListActivity. It would be nice if the fetching of the images would be done in LIFO fashion, because the user wants to see images where he is currently in the list first. What is the best way for me to make such a change? I see that you’re using an Executor in ImageLoader.java (se line 217 of current release). I’m not very familiar with Executor yet, but is there like a “executeFirst” type of call that could be done there instead?

    Comment by tylercollier — July 7, 2011 @ 11:40 pm

    • intriguing idea! Executor is backed by a queue if I’m not mistaken, and I suppose you can configure that queue to pick elements from it in a different order. One thing to keep in mind through is that the order in which jobs are added to that queue can not be influenced. That’s because ListAdapter will create (or re-use) views in the order they appear on the screen. Whenever that “event” is triggered (a call to adapter.getView), an image will be loaded. That means that the order of execution is in fact determined by your list adapter, from the perspective of ImageLoader images are loaded one at a time, using threads from a managed thread pool. Still, may be worth investigating.

      Comment by Matthias Käppler — July 8, 2011 @ 8:28 am

      • I think I’ve done it. It was like I said. There’s a constructor for ThreadPoolExecutor which takes a BlockingQueue, so I used the advice here (http://stackoverflow.com/questions/4620061/how-to-create-lifo-executor/4620114#4620114) and created a BlockingLifoQueue and it seems to work great. I can send you the changes to the source if you’re interested.

        Comment by tylercollier — July 8, 2011 @ 6:48 pm

      • nice, if you happen to be on GitHub, send me a pull request (kaeppler/droid-fu). A patch file will do, too, of course. I’ll have to test this on a separate branch so this may take a while.

        Comment by Matthias Käppler — July 9, 2011 @ 10:19 am

      • Do you have a contact info page? I can’t find your email address or anything. I’m new to github, so my plan is to email it to you now and maybe do a pull request when I have time (I’m getting more into the DVCS).

        Comment by tylercollier — July 14, 2011 @ 6:21 pm

  33. I have been playing around with droid fu, I have a WebImageView which gets the image from a remote server. I also have a progressDrawable set to spinner drawable. Oh yeah, the webImageView is part of a list. Now the picture shows up first time, the second time, I search for same picture then I get the progressDrawable not the image that was downloaded.

    In the logcat shell I see an entry for MEM cache hit for http://acme.example.com/somepicture.

    Comment by Muasir — July 27, 2011 @ 7:20 pm

    • I did couple of things with my code to realize that the issue I am having is because I am calling webImageview.reset() before loading the image (setImageUrl) in a liveview? It was recommended in following article http://davidmarquis.posterous.com/android-listview-with-images-using-droid-fu-w because of the way ListView works. Any idea how I can get around the problem of having progressDrawable showing instead of cached image?

      Comment by Muasir — July 28, 2011 @ 2:07 am

      • I’m having the exact same problem. I do not see why this happens. Any ideas?

        Comment by Alex — September 16, 2011 @ 9:43 am

  34. The WebImageView class is awesome and works perfectly.. Well almost. The latest code in github is causing the ‘skia decoder returned false’ issue. I could not figure out how to fix this in the current code. Any help?

    Comment by Hari — August 30, 2011 @ 11:56 am

  35. Hi!
    WebImageView doesnot work when i try to load a generated barcode, i.e. url = “http://www.barcodesinc.com/generator/image.php?code=91474472&type=C128B”

    any suggestions?

    Comment by Muhammad Abbas — September 22, 2011 @ 10:32 am

  36. can we have just one eclipse working example?

    Comment by ivan — October 15, 2011 @ 6:53 am

    • We’re currently porting Droid-Fu over to a new project, part of which will be provision of proper examples, more modular code, and proper project and release management (and yes, a mailing list). We feel that we’ve reached a point where we cannot provide proper support for Droid-Fu anymore, since there was never any kind of release management. New project is at https://github.com/kaeppler/ignition

      Comment by Matthias Käppler — October 15, 2011 @ 10:32 am

  37. [...] I would consider using droidfu’s image cache. It implements both an in-memory and disk-based image cache. You also get a WebImageView that takes advantage of the ImageCache library.Here is the ImageCache library code specifically:http://github.com/kaeppler/droid-fu/blob/master/src/main/java/com/github/droidfu/imageloader/ImageCache.javaHere is the full description of droidfu and WebImageView: http://brainflush.wordpress.com/2009/11/23/droid-fu-part-2-webimageview-and-webgalleryadapter/ [...]

    Pingback by Android image caching | Android Development tutorial | Android Development tutorial — April 15, 2012 @ 3:06 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Shocking Blue Green Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 37 other followers

%d bloggers like this: