The server is sending a list of urls of images when the
application
loads.After parsing the url,The Application is Supposed to fetch that images from the server and display those images as MARQUEE on it's header as a BANNER.
On Clicking on that
banner
...alink
is to be open(Say for example link of anyWebSite
).Can Anybody tell me how to fetch this image from the url and
Save it temporarily
andDisplay them
as Banner.Regards.
Asked
Active
Viewed 1,710 times
0

Haresh Chaudhary
- 4,390
- 1
- 34
- 57
-
http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview instead of Listview in your case display those in Banner – user370305 Jun 20 '12 at 05:17
-
Please see the Edit..have added one More Point..:) – Haresh Chaudhary Jun 20 '12 at 05:28
-
The marquee example is given here: https://github.com/blessenm/SlideshowDemo – Krishna Suthar Jun 20 '12 at 05:30
3 Answers
2
- Use AsyncTask for downloading images from server (Store them in external storage).
- After complete the download display those images in Gallery view as a Banner. (Put Gallery view in banner).
- As Android Gallery doesn't support Marquee, use animation for Gallery view (Like Marquee).

user370305
- 108,599
- 23
- 164
- 151
2
I used this code for loding img form url
ImageView v_thumburl = (ImageView) rowView
.findViewById(R.id.v_thumb_url);
thumburl = temp.getString(temp.getColumnIndex("thumburl"));
Drawable drawable = LoadImageFromWebOperations(thumburl);
v_thumburl.setImageDrawable(drawable);
private Drawable LoadImageFromWebOperations(String url) {
try {
InputStream is = (InputStream) new URL(url).getContent();
Drawable d = Drawable.createFromStream(is, "src name");
return d;
} catch (Exception e) {
System.out.println("Exc=" + e);
return null;
}
}
try this i hope it may help u

Jagan
- 692
- 1
- 12
- 38
1
For Loading Image from The Server you can use LasyList which will fetch the image from server and store it into SD Card.
SlideShow will be better than Marquee, so if you want SlideShow see this
And If you want marquee then what you can so is have and HorizontalListView
Add a public Method in HorizontalListView Class as shown below
public void getScrollWidth() {
return mMaxX;
}
public void getCurrentScrollX() {
return mNextX;
}
and For Marquee have a Thread and a Handler in your class like this.
new Thread(new Runnable() {
@Override
public void run() {
try {
handler.post(new Runnable() {
@Override
public void run() {
if((horizontalListView.getCurrentScrollX() + 50) < horizontalListView.getScrollWidth())
{
horizontalListView.scrollTo(horizontalListView.getCurrentScrollX() + 50);
}
else
{
horizontalListView.scrollTo(0);
}
}
});
Thread.sleep(1000);
} catch (Exception e) {
}
}
}).start();

Vivek Khandelwal
- 7,829
- 3
- 25
- 40