I am working on a dynamic thumbnail service based on thumbor which will provide any size thumbnail for given image and will cache it. Ideally I would like to constrain sizes of thumbnails so that cache will be effective and I can pre-cache those size images. Ideally different types of image sizes to be pre-cached should be calculated based on screen density, screen size and network speed so that android will request suitable size image.
I would like to know how to calculate multiple dimensions of images to be pre-cached and how to decide on android which size image to get.
Brute force way is to not to constrain image sizes and just ask for image with width equal to screen width in pixels but will be waste of cache since even minor difference in screen widths of two devices will need different size images to be cached.
based on screen configuration chart in this url, I can cache images of all widths specified in this chart. On runtime, I can calculate which row and column in this chart current device fits based on these links Get screen size, Get screen dpi