Warning this article may contain opinions of the author that you and iTWire don't agree with.
Visit the last page to have your say in our forum.

No. 1 Story

Telstra adds one million mobile services, but Sensis plummets

Telstra has revealed the addition of almost one million new mobile services in the six months to December 2011, but Sensis revenues plummeted 24 percent in 12 months.

read more

Developing for Linux netbooks

Opinion and Analysis

Now, netbooks are priced at a low level; I think that’s been said enough times already. Linux certainly was a major enabler in this because it eradicates any reason to pay licensing fees for the software driving the device. Yet, let’s be reasonable: Linux can’t take all the credit for the low price. The fact is netbooks have much lower specifications than any modern laptop.

This manifests itself in several ways. Firstly, the amount of available RAM is constrained. The Elonex ONE ships with a mere 128Mb RAM. Acer’s Aspire One carries by comparison a massive 512Mb RAM (as does ASUS’ Eee.) This doesn’t necessarily mean RAM levels are scraping the (bit) bucket; a popular and easy ‘hack’ for the ASUS Eee has always been to replace the built-in 512Mb RAM with a 2Gb chip instead.

Perhaps tellingly, the more expensive Windows XP version of the Aspire One is equipped with 1.5Gb RAM. One option canvassed on varying forums is to purchase the Windows XP version and then trash the Windows XP installation, replacing it with one’s preferred Linux distro, or perhaps BSD UNIX in some cases. This isn’t the best route given you’re not just paying for better hardware but also for Windows XP. Nevertheless, it emphasises the general consensus that netbooks aren’t typically regarded as having available memory in elephantine quantities.

Let’s get onto some actual matters of code. First, it may be helpful to work out how much RAM you have to play with so that your application can make different decisions. Say, for instance, you were writing a chess game. Your computer controlled player would want to make reasonably intelligence moves and you can achieve this by calculating the state of the chess board in advance and then placing pieces according to the routes which seem to lead to more favourable outcomes. Knowing the amount of RAM available will permit you to increase or decrease the number of moves ahead the computer player can peek.

Under Linux you can view the current state of memory on the running system by examining the plain text file /proc/meminfo. The format varies somewhat depending on the distro but if you inspect the version on your system now you will see it includes both some high-level statistics and then a longer list of individual statistics. The MemFree figure is, as you might expect, the amount of free memory at the time of checking. Check it out directly via the command grep MemFree /proc/meminfo.

To work out the available screen resolution you should inspect the output of the xdpyinfo command. Specifically, search for the line containing the string “dimensions:” like so:

[david@dmw ~]$ xdpyinfo | grep ‘dimensions:’
Dimensions: 800x480 pixels (283x170 millimetres)


xdpyinfo is a little-known utility that displays information about an X-Windows server. It examines the capabilities of the server and can give detailed information about the screens and visuals available. For our immediate purposes, being able to determine the screen size at run-time is very useful because an app can then sensibly resize itself to suit. Perhaps it may shrink the icons used on a toolbar, or make toolbars floating instead of docked or do other things to avoid the bottom of the window falling off the screen. It’s possible, depending on your needs, xdpyinfo has other valuable information for you too.

What else should you consider when coding for a netbook?

CONTINUED







- sponsored feature -

The Death of Traditional BI: What’s Next?

How to Make Business Discovery Work for Your Business IP PABX BUYING GUIDE

Business Discovery takes its cues from consumer apps. Like Google, it encourages us- ers to hunt for and explore data without worrying about or even noticing the underly- ing technology. Their entire experience is working within an intuitive interface to get real-time, self-service results with only minimal training. ...more