I have a list of sites that I display in WebView , can I somehow find out in advance, before display, whether the website is mobile responsive or not?

I mean, how do I know that the layout of the website is adapted for a mobile phone? For example, I do not want to display sites that are not adapted.

example:

enter image description here

  • and what exactly is mobile responsive? How to distinguish this site from the usual? - Vladyslav Matviienko
  • @metalurgus Under non-mobile responsive, I mean sites where the layout is not adapted for mobile devices, for example, the text does not fit the full width of the screen. - Lucky_girl

1 answer 1

It is definitely impossible to detect an adaptive layout in the general case.

You can, of course, try to look for its characteristic features, like the meta tag viewport and similar things, but, in general, it will not work.

Alternatively, you can trust the service from Google and ask him. If, in the opinion of this service, the site has an adaptive layout, then it will tell you that:

Fine! The page is optimized for mobile devices.

otherwise, you will receive:

Not optimized for mobile devices

In other words, before displaying the site, make a request to this service and parse the result, if everything is ok - show the page, if not - then not.

  • Can I somehow check the website programmatically from the phone using this service from Google? Does it have its own API? - Lucky_girl
  • one
    @Lucky_girl, I haven’t found the API, but in your application you can interact with this service via GET requests. - post_zeew