Avoiding Android Fragmentation in Hybrid Mobile Development
JasonHunt 0100003ETE Visits (4829)
I recently had the opportunity to attend the Stra
Avoid Absolute Positioning
The presentation started with one of the basic best practices for addressing varying device sizes: don't use absolute positioning. Android provides several layout types to avoid absolute positioning - such as LinearLayout - which can do proportional layouts. The good news is that HTML has grown up over the years with the fundamental requirement of supporting different screen sizes and, as such, HTML inherently avoids absolute positioning with the core HTML constructs. That's not to say that you can't do absolute positioning in HTML 5, particularly with Canvas, so caution is still warranted.
Adapting to the Device
Chiu-Ki spent a lot of time in her presentation emphasizing the benefits of the Andr
This code-driven and nested folder structure gives you a lot of flexibility in determining where to put your assets, while minimizing duplication of those assets across folders.
Image & Pixel Tips and Tricks
Chiu-Ki also gave some tips on how to handle images well across different orientations and screen sizes, using techniques such as gradients for lightweight images and tiles for efficient backgrounds. Fortunately, both of these techniques are supported in CSS (gradients, backgrounds) and HTML5 Canvas (gradients and tile
The presentation also covered the dens
In the end, it was comforting to find that many of the same techniques used to handle Android fragmentation natively could also be done in hybrid development. As you can see, using IBM Worklight with HTML5 will give you the flexibility you need to write mobile applications that behave properly across many different mobile platforms and mobile device characteristics.