Getting Started with the Trolltech Greenphone SDK
For an excellent example of a Linux program using GSM AT command codes, check out Gnokii—it's a great tool for learning about GSM modems, as you actually can watch each transaction with the data sent and received to execute commands to dial the phone, send SMS messages and so on. It works well with most modern phones that have a serial or USB data connector. By the time this article is printed, it might already be running natively on the Greenphone. For complete details, visit www.gnokii.org.
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.
One technique for VM-based cross-platform development is to export your display from the Linux VM to your host machine running an X11 server. This might be the built-in X11 server running locally on your Linux host, Apple's optional add-on to OS X or even Cygwin on a Windows machine. I use screens rotated 90° to allow reading many more lines of code without scrolling, so this trick helps to leave the VM configurations as generic as possible. GUI performance typically is enhanced when the X server is run on the host machine due to the lowest level rendering being shoved off as far down the pipeline as possible—often at the display adapter's GPU. Using this method, it can almost make Windows and OS X feel like a Linux box.
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.
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:
Otherwise, if building for the actual Greenphone itself, we would choose the cross-compile environment with:
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.
It might be worthwhile to point out that the commands depicted here are separated by a double ampersand (&&) to cause execution of the command string to stop at the first point where it meets an error. In this case, it would stop the shell from trying to execute or install a program that had failed to build.
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.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- ServersCheck's Thermal Imaging Camera Sensor
- The Italian Army Switches to LibreOffice
- Linux Mint 18
- Petros Koutoupis' RapidDisk
- Oracle vs. Google: Round 2
- The FBI and the Mozilla Foundation Lock Horns over Known Security Hole
- Privacy and the New Math
- Ben Rady's Serverless Single Page Apps (The Pragmatic Programmers)
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide