Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Detection of Retina (high-res) display
Hi,
how can I detect in Vaadin that a session is running on a high-res display?
I see that if I display images with double resolution it looks significantly better on a Retina display.
However, sending larger images to non-Retina displays makes no sense and may look even worse, for example with IE11.
How would this be handled best?
Thanks in advance!
Andreas
Hi Andreas,
have a look here:
view-source:http://whatsmy.browsersize.com/
and at
http://stackoverflow.com/questions/19689715/what-is-the-best-way-to-detect-retina-support-on-a-device-using-javascript
to get an idea of how to query the browser for its resolution.
Once you know the resolution available, you could write a pure-JS (without GWT) add-on for Vaadin that relays the information to the server-side session. Some example for such small add-on is here:
https://github.com/enver-haase/NumberCaptcha
I didn't find a ready-made solution here: https://vaadin.com/directory
so it would be nice if you could publish your solution there when you're finished.
HTH, Best Regards,
Enver