Duqe
Duqe

Reputation: 339

Android: Download images from web and show them on gridview

I want to create a program that gets some images from a webpage, and shows them on a gridview. I dont know how many of them exactly. It could be from 20 to 30. Ill do it with asynctask, which i have allready used before and more or less know how it works. But i don't know which way use it this time.

For now, what i would like to get is a progressbar (circle clicking) while image is downloading. And once its downloaded, it would disappear and image will load. I will use an array of objects with an adapter, to fill the gridview.

Which way would you use the asynctask?

Thanks in advance.

Upvotes: 2

Views: 4293

Answers (2)

Arseniy
Arseniy

Reputation: 1778

If you want to save downloaded images and reuse them in future then you must look DownloadManager

To display dialog with cycling circle, look this: howto use ProgressDialog

Upvotes: 0

Tom
Tom

Reputation: 7091

I would suggest you check out Lecture 6 of Harvard Extension CS76. There is a URLImageAdapter and example source code that does example what you are looking for.

Best of luck

Upvotes: 5

Related Questions