0

Having trouble downloading an image when using the Android Query (aQuery) library to download image that has redirect:

Using url https://api.twitter.com/1/users/profile_image?screen_name=scottyab&size=bigger

in web browser redirects to

https://si0.twimg.com/profile_images/2467461312/5rab7gapdrnd84b6nflx_bigger.jpeg

Here's the activity code for doing the async image call:

aq.id(R.id.twitter_image)
                    .progress(R.id.twitter_image_progress)
                    .image(getTwitterProfileUrl(twitterName),
                            true, true, 0, R.drawable.no_profile_placeholder,
                            new MyBitmapCallback());

Getting an internal AQuery error 101 network error. This there an option to enable AQuery redirect? The URL returned in the call back is the original url not the redirected URL. Specifically finding this an issue on Android 2.1

scottyab
  • 23,621
  • 16
  • 94
  • 105

1 Answers1

0

Android-Query doesn't appear to handle redirects currently, and it looks like it would require a code change to support them.

I took a look at the AQuery source code, and I think this is the code to do the request: https://code.google.com/p/android-query/source/browse/trunk/src/com/androidquery/callback/AbstractAjaxCallback.java#1483

Here is how it could be implemented to follow redirects: Httpclient redirect handler

It would have to handle codes >= 300 and < 400 to handle redirects.

Community
  • 1
  • 1
Joe
  • 3,059
  • 2
  • 22
  • 28