Android fetching images from url & storing on devices and then again using it -


hi guys started developing android application , bit confused on best way accomplish it


application flow

when activity starts fetches data database(sqlite), database returns list of data ,this list of data contains text , url image.

so want activity start listview populated text data , images.

  • the images first searched locally if not present images fetched url after fetching completed image added respective view , stored on device

  • these images once downloaded should remain on device until app uninstalled


issues

as start activity list view gets populated data local database images takes time download

so tried asynchronous image loader problem if activity started , device isn't connect net image wont show after if connect internet these images wont show


is easier way handle images if need delete these images in future can. if 1 can provide refrence project or available libraries handle these task .thnx in advance

i don't way loading images list suggest use picasso library load images : url:

picasso.with(context).load("http://i.imgur.com/dvpvklr.png").into(imageview); 

for resource :

picasso.with(context).load(r.drawable.landing_screen).into(imageview1); 

loading file:

 picasso.with(context).load(new file(...)).into(imageview2); 

more details here: http://square.github.io/picasso/


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -