Feeds

Punch out your own code on a Greenphone

We get keyed up about Trolltech's Qtopia

Top 5 reasons to deploy VMware with Tegile

Trolltech's Qtopia is a commonly used mobile Linux. It's used in a large number of different devices – from Sony's mylo communicator, to Motorola and Panasonic's Linux phones. While you might not have come across it in the Carphone Warehouse, it's a common platform in one of the biggest mobile markets going – China.

But how do you develop for a phone platform that's not widely available over here? And how do you develop applications that link deep into a phone's operating system – and even change the behaviour of that OS? You could work with a phone virtual machine (after all, Microsoft's phone simulators are actually custom versions of Virtual PC). Trolltech is offering another approach – the Greenphone, a phone designed for developers along with a development platform that makes it easy to work with all aspects of the hardware.

Picture of the Greenphone.

The Greenphone hardware compares favourably with most consumer devices, and it's built around a 312MHz XScale processor, with 64MB of RAM and 128 MB of Flash (there's also a Mini-SD card slot for up to 512MB of extra storage). Unlike most phone format devices, there's a QVGA touch screen, so you can develop applications that work on keypad-less devices. Connectivity is through a GPRS modem and USB. While there's Bluetooth and a 1.3 Mpixel camera, there's no WiFi. The device costs $695, with development packages adding at least $195 to the cost.

Open the box and you'll find a CD with the SDK (alternatively you can download it from www.qtopia.net). You shouldn't compare the Greenphone to your everyday mobile SDK. This one lets you work with the phone kernel, as well as the applications – and then deploy it to actual hardware.

However, it's not a true open phone; it's an open development platform for what may end up as closed devices. That may seem a contradiction in terms, but when you're developing applications that need deep integration with a phone's hardware it's actually a key requirement.

Trolltech have made a smart move with the Greenphone's SDK. Instead of configuring various packages for a selection of operating systems (and then having to support them), they've made a smart decision: virtualising a development platform. What Trolltech has ended up delivering is a pre-configured Debian Linux environment. This has been filled with development tools and documentation, and then turned into a VMware image. There's no need for Trolltech to distribute VMware, the free VMware player is widely available.

Shows the Qtopia development environment.

Once you've installed the Trolltech image from the bundled CD-ROM (or from the qtopia.net web site), you can start developing code straight away. The SDK contains all the compilers you'll need, along with source code and plenty of documentation. The amount of code you'll get depends on the version you've chosen – the Community edition only contains the code for the applications, you'll need to Professional edition for the full platform source. If you've worked with QT, you'll find Qtopia a very familiar environment. It's made easier with plenty of online documentation and a design tool for building UI components. There's even a set of tools for managing internationalisation (something that's increasingly important for mobile application development).

Building applications is easy enough, and the bundled sample code gives you enough of a jump-start. Applications are developed in C++ and the Qtopia variant of QT. Application development begins in Trolltech's own Designer. Start by opening a new project, and then creating its UI using the Designer. Trolltech provide most of the controls you'll need for most classes of phone application. You'll need to drag and drop components onto the design surface, and Qtopia will make sure they're displayed correctly on the Greenphone. Once you've built the UI, all you need to do is wire up the UI to your business logic. The SDK comes with the KDevelop IDE, so you can use this to write your code. If you've worked with QT, you'll find Qtopia development familiar – using its SIGNAL and SLOT to link controls to functions. We used this to write a simple Hello World-style application that took information from a form and displayed it using a LCD-style display font. We connected a pushButton control to code that handled both form content and display:

Connect(pushButton, SIGNAL(clicked()), this, SLOT(showValue()));

The showValue() function takes information out of a line edit control and displays it on the LCD control. We can do this with a mix of QT components and C++:

QString value_str = lineEdit->text();
Float value = value_str.toFLoat();
lcdNumber->display(amount);

Compilation is slightly different from standard C++. You'll need to make sure that you set up the appropriate Qtopia environment variables, and use the qtopiamake command before running a standard make. Qtopia certainly makes it easier to deliver C++ mobile applications, handling complex user interface issues while giving its control components a relatively simple API. Developers used to Eclipse or Visual Studio may find it hard to get to grips with the Greenphone SDK – building and deploying an application takes two separate development tools and a command line...

Shows a Hello World application.

The Greenphone SDK can be connected to the Greenphone using a USB connection. There's no need to worry about Windows or Linux drivers – the SDK handles communications for you, though you'll need to turn on USB Ethernet networking on the Greenphone before making a connection. The SDK's command line tools handle packaging and installing your applications on the Greenphone, ready for use. This is not a consumer phone, it's a tool for platform developers and developers who need access to phone hardware. If you're building Linux Bluetooth applications that use a phone's camera, then this is an ideal device for making sure all the various components of your application work together in the constrained environment of a mobile device. It'll be interesting to see how the Greenphone competes and compares with the recently released OpenMoko developer hardware.®

Secure remote control for conventional and virtual desktops

More from The Register

next story
Euro Parliament VOTES to BREAK UP GOOGLE. Er, OK then
It CANNA do it, captain.They DON'T have the POWER!
Download alert: Nearly ALL top 100 Android, iOS paid apps hacked
Attack of the Clones? Yeah, but much, much scarier – report
NSA SOURCE CODE LEAK: Information slurp tools to appear online
Now you can run your own intelligence agency
Post-Microsoft, post-PC programming: The portable REVOLUTION
Code jockeys: count up and grab your fabulous tablets
Twitter App Graph exposes smartphone spyware feature
You don't want everyone to compile app lists from your fondleware? BAD LUCK
Microsoft adds video offering to Office 365. Oh NOES, you'll need Adobe Flash
Lovely presentations... but not on your Flash-hating mobe
prev story

Whitepapers

10 ways wire data helps conquer IT complexity
IT teams can automatically detect problems across the IT environment, spot data theft, select unique pieces of transaction payloads to send to a data source, and more.
A strategic approach to identity relationship management
ForgeRock commissioned Forrester to evaluate companies’ IAM practices and requirements when it comes to customer-facing scenarios versus employee-facing ones.
How to determine if cloud backup is right for your servers
Two key factors, technical feasibility and TCO economics, that backup and IT operations managers should consider when assessing cloud backup.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Choosing a cloud hosting partner with confidence
Download Choosing a Cloud Hosting Provider with Confidence to learn more about cloud computing - the new opportunities and new security challenges.