androidandroid-volleyandroid-screen-supportscreen-density

Android - Images from an URL through web services according to Screen Density?


I'm working on an Android app. It pretends to be for many countries, so I need to change some icons, and "drawables" according to the user's country that has logged-in to the app like user's country Mobile Operators, maybe country's flag, etc.

I was planing to get those restfully through an URL on the web service (using Volley).

But, talking about Android's multiple screen densities, I don't know if in this case is "valid" to get ONE single image size from the service to put it on the app, or depending on the device's screen density then request the respective images to the server (if it is a good practice).

How have you proceeded on these cases? Any comment I will really appreciate, thanks!!


Solution

  • Just to close this question, I'm going to answer it based on what I've been lately when fetching images from server:

    As Google recommends: https://youtu.be/HY9aaXHx8yA?t=4m4s

    I use Picasso to fetch images from internet. This library handles all resizing and caching very cool and simplifies everything. It can be used even with local resouces.

    I recommend using this library for this task.

    Cheers.