Getting Started with the Trolltech Greenphone SDK

Everything you need to know to start programming for the cool new Greenphone.
Getting Ready

Loading the development environment is simple—run the installation program on Windows or Linux, respond affirmatively to the prompts, and within a minute you will have VMware and the SDK tools, application sources, documentation and binaries installed with an icon on your desktop to start things up.

This makes life really easy for reluctant developers using MS Windows to get into both embedded and desktop Linux and Qt application development.

At the time of this writing, developers using the x86 version of Macintosh OS X can use the Greenphone SDK under VMware Fusion, but they need to copy over the virtual machine's files from another installation; however, this may change by the time this article is published.

Getting Started Building Applications

Trolltech always ships its products with copious documentation and example code demonstrating all common features, and the Greenphone SDK is no exception. For starters, the “Developer Quickstart Guide” shows what needs to be done to build an application with a few one-liners.

First, we start the Qtopia emulator using the Qt Virtual Frame Buffer and a Greenphone skin by clicking on the runqvfb icon on our desktop. This is analogous to an X server for Qtopia, and it provides an exact pixel-for-pixel representation of the program running on the phone.

Then, we start the Qtopia phone environment by clicking the runqpe icon, which then connects to the qvfb process and displays its contents in its virtual screen.

Figure 2. qvfb Running with qpe Running in It

We need to run a script to set our QPEVER and PATH environment variables and to define some functions for communicating to the phone. If building for the x86 version of Qtopia, we would use:

. /opt/Qtopia/SDK/scripts/devel-x86.sh

Otherwise, if building for the actual Greenphone itself, we would choose the cross-compile environment with:

. /opt/Qtopia/SDK/scripts/devel-greenphone.sh

Then, we change to our directories and build:


cd ~/projects/application
qtopiamake -project && qtopiamake && make && gph -p -i

The qtopiamake program is Qtopia's version of the Qt qmake utility. It can generate a .PRO project file based on the contents of the current directory if given the -project parameter, but its most important job is to use the project file as the starting point to generate a Makefile based on the installed configuration of Qtopia and the type of build we want.

Typically, we generate a new .PRO and Makefile only when we have new files to add to our project, but qtopiamake takes so little time to execute that it is common to see it run from a standard shell script every time.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

reply this post

Anonymous's picture

Don't you understand that this is correct time to get the loans, which can make you dreams real.

hi i have a graduation

motsh's picture

hi
i have a graduation project and i want to develop aprogram on green phone but i still need help please if any one has experience please email me
mohamed.gamal21@yahoo.com

RIP Linux Greenphone

eosorio's picture

Greenphone

teia's picture

Is this phone available to buy for use as a regular phone? My contract is almost up and I want a Linux smartphone...

Great info. Thanks.

Weird Dude's picture

Great info. Thanks.

Beating the OpenMoko to It

Roy Schestowitz's picture

Thanks for a refreshing review (and a sigh of relief after Ty's take, which left room for doubt).

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix