0 Replies Latest reply on Nov 2, 2011 10:26 PM by rsmithh

    Some questions on mobile device detection

    rsmithh Newbie

      Thanks to Burr, Brian and Jay for the RF On Mobile webinar yesterday. Exciting stuff.

       

      I've just come off the back of an Android app, and was pretty impressed at how it deals with device detection. Three items in particular I have come to believe are indispensible when developing apps for Android.

       

      1. Device rotation fires an event. In Android's case it's a fairly dramatic event, that causes what amounts to an application restart, but the premise is clearly that with the dramatic change in screen dimensions, the app will probably need to do a dramatic rethink about what the user sees.

       

      2. The layout folder hierarchy that dynamically and declaritively assigns different screen layouts, and even different low level dimensions based on screen size, density and orientation. As a low level example, when I declare my layout (think CSS equivalent), instead of declaring my font size to be 20px, I can declare it to be a variable, say font_size. In my folder hierarchy, I declare multiple assignments to font_size based on device dimensions and orientation. At no point does my app ever need to query dimensions and manually assign layout. It's all been done on my behalf based on my declarations.

       

      3. Coupled with device-specific layout, is "fragments". This is the ability for the device-specific layout to not just determine the appearance, but also what functionality appears within that layout. The canonical example is a file explorer. On a small device I have a list of folders, which I click to see a list of files. On a tablet, I have the folder list and the file list list side-by-side.

       

       

      As I developed against a range of Android devices, from a 240x320 3.2" HTC Wildfire through to a 1280x768 8.9" Galaxy Tab, I found that without the three aspects above, I would have been on a journey to hell trying to code device detection into my app with a rats nest of switch statements that would be impossible to test and debug.

       

      Item 2 can be partly addressed with CSS3 media queries. However I do feel that CSS needs a little help at the framework/IDE level, to (a) allow the multiple variations and their interrelationships to be elegeantly defined, and (b) to provide a way to visualise the results on different screen dimensions without having to execute my app.

       

      My 2p is that any mobile HTML5 framework that can find an equivalent solution is a winner. On the other hand, without such features, I'm slightly hesitant to consider HTML5 for anything other than static web pages.

       

      Thx again for a great product and great support

      Roy