In My app I have to do some resolution specific work and I have to get the resolution and send it to server accordingly. Now My server have images which entertains the following resolutions...
- 320 * 480
- 480 * 800
- 800 * 1200
- 720 * 1280
- 1080 * 1920
- 1440 * 2560
I am getting resolutions in the following way
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;
so As we know there is so may resolutions so there would be some devices whose resolutions slightly different from the set of resolutions I have mentioned above such as I have a device which has 800px * 1172px
waht I want
So tell me how can I compare the device resolution with the set of resolution and send the resolution which maintain the resolution categorized images.
also if the device has resolution which is not exist in my pre determined set of resolutions , then I want to send the resolution closer to it.
Please help me , I do not know how to do it.