Results 1 to 4 of 4
  1. jeffa00's Avatar
    Posts
    110 Posts
    Global Posts
    156 Global Posts
       #1  
    I've recently re-designed my website to detect mobile devices and format for them.

    I'd appreciate feedback on my site: GalacticBeacon.com.

    If you are on a desktop you get a two column design and on a mobile device a single column design with fonts adjusted to be readable. I've tested on my Pre Plus and the emulator for Windows Phone 7.

    The site has my comics and blog. Some of the stuff is available in my app (link to trial version in my sig).

    If anyone is interested in the technical details the site is running a blog/comic engine I wrote in asp.net mvc. I'm hoping to improve it over time.
    Original science fiction, fantasy and comics for WebOS - Galactic Beacon: Volume 1
  2. #2  
    Well done!

    What code do you use to detect the mobile device, I have been trying to build a similar site myself but have been unable to detect a webOS device.
    Palm m130 > Verizon Trēo 650 > Verizon Trēo 755p > Verizon Palm Prē Plus > TouchPad > Verizon Palm Prē 2
    ~ The Future's Just Not What it Used To Be ~
  3. #3  
    Quote Originally Posted by not-yet-pre View Post
    Well done!

    What code do you use to detect the mobile device, I have been trying to build a similar site myself but have been unable to detect a webOS device.
    It depends what language you use.

    If you use PHP, this would do:

    Code:
    <?php
    if (preg_match("/webOS|Android|iPod|iPad|iPhone|Mobile Safari/", $_SERVER['HTTP_USER_AGENT']) === 1) {
    // we're on one of the many mobile devices
    } else {
    // not one of the listed mobile devices
    }
    Arthur Thornton

    Former webOS DevRel Engineer at Palm, HP, and LG
    Former webOS app developer (built Voice Memos, Sparrow, and several homebrew apps and patches)
    Former blogger for webOS Nation and webOS Roundup
  4. jeffa00's Avatar
    Posts
    110 Posts
    Global Posts
    156 Global Posts
       #4  
    Like Arthur said there are several ways to do it depending on your environment.

    I did it in asp.net MVC since that's what I wrote my blog/comic engine in, but the workhorse is WURFL (Wireless Universal Resource FiLe).

    In a nutshell WURFL is an XML file that contains a metric buttload of device info. With it you can go to some pretty sweet lengths of customization.

    There are several libraries you can get that use WURFL, but the one I used was 51 Degrees. It is simply a .Net library for WURFL.

    The WURFL site links to PHP and Java libraries too. There are probably more.

    My next step will be to differentiate between phones and tablets.

    I haven't even begun to scratch the surface of what the library can do.

    What I do now is determine if the browser is a mobile device and choose either a mobile theme or a desktop theme respectively. My themes contain CSS files and .Net Site.Master files. That allows you to pretty fully customize your UI.

    The library abstracts the process to the point that you simply ask the request object if the browser isMobile. Behind the scenes the library has loaded up the WURFL file and parsed it into objects. WURFL has signatures that the library can use to identify devices and classes of devices.

    I've been annoyed at how bad most sites look on my Pre when they could look great... especially my sites. I can't change all the other sites, but I can change mine!
    Original science fiction, fantasy and comics for WebOS - Galactic Beacon: Volume 1

Posting Permissions