0

I have an android application coded with Java in Android Studio. I published my Restful Api to web server. Whenever i open my android app, the pictures uploaded to the server can not be downloaded to the app via Picasso. Moreover I can not access these pictures under App_Data folder. Any solutions?

1 Answers1

0

I want to share that answer in case someone needs it.

The accessing problem to my pictures under the App_Data folder was caused by a missing virtual directory matching. First i created a virtual directory pointing to my pictures folder under App_Data. Second i tested whether i can access these pictures with chrome browser. if i typed the correct path with the new created virtual directory i can access via web browser.

But the key issue is that i can not access these files again from my app. I found the reason by deep diving and analyzing.

The actual problem is that: When i tried to access these files by my android app, Picasso assigns some mapping in its cache. which is under my android app folder. Because of this cache, no matter i fixed the virtual directory issue Picasso can not access them. Picasso only checks it's cache and if there is a 404 error for that file it doesn't try one more time. So at the and i completely uninstalled from the device and i installed it again. After that everything is fine!

Edit:clearing picasso cache also works. But it must be used on similar conditions, otherwise clearing picasso cache can affect load times as well as internet usage.

  • So, [clearing the cache](https://stackoverflow.com/questions/27502659/clear-cache-memory-of-picasso) didn't work? Uninstalling doesn't seem like a valid answer – javdromero Jun 22 '21 at 20:14
  • Clearing the cache actually worked. But because i was using emulator i just uninstalled the app and installed again. You can clear picasso cache as mentioned in that post: https://stackoverflow.com/questions/27502659/clear-cache-memory-of-picasso but you have to be carefull about clearing cache because picasso works with cache to reduce load time and internet usage. – Hüseyin K. Jun 23 '21 at 21:15