0

I have an application which downloads the image and saves in the sdcard of the device and meanwhile it saves the name of downloaded image in the database along with their path (this path is a physical path on device)

Why I am doing this? It has only one reason and that is not to download images again and again from the server. But as I am saving them in the sdcard then they are showing in the Gallery. So there is chance that user can delete some of the images or may be all of them. (Due to some reasons I am not saving them in app folder)

So what I want

I want couple of things that can be simplify as following

  1. I want to see that if any of the image has been removed/deleted by the user, if so then I may download that also and then I will update my Grid view accordingly. If there is no deleted image then it should show normally.
  2. I searched on internet and I found one method to check if the file is still there "myFile.exists()" but do not know how to use it in my case.
  3. This is the worse point and could be hard of my logic, what Is going on now is I open my activity and it takes the image path from the database and fetch the image into the imageview. but what If there is sime 1 present , image 2 present but not image 3 , image 3 is deleted by user , then Now How to adjust this thing , as we are in the adapter of the gridview, how we would wait and download this image and would fit it at that place ?

Please tell me How to do this and How to check if any of the file has been deleted. ?

Community
  • 1
  • 1
Coas Mckey
  • 701
  • 1
  • 13
  • 39

0 Answers0