1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Programmatically detect a mobile website?

Discussion in 'Web Design' started by Nick1, Jul 1, 2012.

  1. Nick1

    Nick1 Junior Member

    Joined:
    Oct 16, 2009
    Messages:
    196
    Likes Received:
    45
    I'm trying to go through a fairly big list of websites to check if they have a mobile version.

    Are there any elements I should watch out for in particular that are not present in "normal" websites?

    Thanks BHW
     
  2. Zak_A

    Zak_A Jr. VIP Jr. VIP Premium Member

    Joined:
    Mar 16, 2008
    Messages:
    808
    Likes Received:
    873
    Gender:
    Male
    Occupation:
    WP designer & developer
    Location:
    Western Europe
    There are many different ways to achieve a mobile version, such as:
    - Responsive design (essentially achieved with media queries in CSS)
    - Redirection (when you try to access the website from a mobile, you're redirected to http:/ /m.website.com - for example)
    - WP plugins such as WPTouch that replace your current theme when accessed from a mobile
    - and probably many more

    That is to say, I'm not sure there is surefire way to automatically sort through your list and tell which one has a mobile version or not.
    Though if someone has a solution, I'd be interested to hear it too.

    Otherwise, you'll probably have to browse to each one with your smartphone, or pay someone to do it for you.
     
  3. oxonbeef

    oxonbeef BANNED BANNED

    Joined:
    Jan 4, 2009
    Messages:
    2,242
    Likes Received:
    7,872
    ^^ However you might do it quicker if you use an emulator like http://www.howtogomo.com/en-gb/d/test-your-site/#getmo-meter
    It's by google and produces a cool report if selling mobile sites to non mobile clients.
     
    • Thanks Thanks x 1
  4. ukescuba

    ukescuba Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 24, 2008
    Messages:
    994
    Likes Received:
    634
    Occupation:
    Mobile Marketer & QR Code Junkie
    Location:
    San Antonio, TX
    Home Page:
    I do like thegomo site but I think blue train mobile is a little better and goes more in depth with their review

    Other alternatives you can look at are as follows:

    There's a qr code plugin you can get for Firefox (I think it's called 2d barcode) am on my iPad right now so can't check till later

    - once installed open up the URL you want to check in Firefox
    - hover your mouse over the plugin so it generates the qr code
    - scan the qr code with your smart phone/itouch
    - if they have a mobile site you should be redirected to it

    Sometimes mobile sites don't react to mobile emulators as they do on a real device

    Also there is user agent switcher for Firefox - problem is with that if the desktop mobile redirection script is using JavaScript screen size detection it won't function if your looking at it on your desktop.

    Additionally another flaw in screen size detection is that many of the new android devices show incorrect screen sizes typically larger that 600 px which is what I find many of these scripts set too...

    If you can't get your hands on a real mobile handset - check out perfectomobile.com

    Hope that helps

    Uke
     
    • Thanks Thanks x 1
    Last edited: Jul 4, 2012
  5. m4dm4n

    m4dm4n Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 15, 2010
    Messages:
    221
    Likes Received:
    92
    Occupation:
    /dev/full
    Location:
    /dev/urandom
  6. John_E

    John_E Newbie

    Joined:
    May 13, 2009
    Messages:
    4
    Likes Received:
    1
    As previously mentioned, there are a number of ways by which the mobile version of a website can be shown, which makes it virtually impossible to ascertain whether or not a mobile version exists just by looking at code elements.

    Other than using an actual smart-phone, the next best approaches are:

    1. Use the Safari Browser with User Agent set to iPhone. This will let detect a mobile version.
    2. Download a smart-phone emulator (not a simulator). There are some good, free ones online such as Mobilizer.

    Neither method is 100% effective, but certainly close enough to get you what you need.

    Hope this helps,
    John