Getting Started with the Trolltech Greenphone SDK
The gph utility is a useful awk script that provides convenience functions for doing things like building, packaging, installing and running applications in the Qtopia environment, either emulated or actually on the phone. It can be invoked instead of make, and it is powerful enough that we can use it to convert from raw source code to running applications installed from a package onto a real or emulated device.
For example, to rebuild the code, package it and install and run on qvfb, we would try the following command:
gph -C x86 -debug -c -all
If that were to go well, and we were happy with enough to want to run it on an actual phone, we could build ourselves a package to install with the following:
gph -C greenphone -p
This would give us a file in our pkg directory with a name like qpe-application_1.0.0-1_arm.qpk.
To have a more complete idea of the gph capabilities, we can look at its help message:
$gph --help FORMAT: /opt/Qtopia/SDK/scripts/gph <options> Options: -h display command help -q quiet mode -c clean -C <opt> reconfig <x86> or <greenphone>, default greenphone -b make -p make package -i install package to greenphone -r run application on greenphone -all reconfig, make, make package, install, run -debug force configure for debug build, override default -release force configure for release build, override default -options "<opts>" pass extra options to build system eg. /opt/Qtopia/SDK/scripts/gph -C x86 -all -options "CONFIG+=debug" -net bring up network to greenphone -console console on greenphone -qpk <file> install qpk to SDK http server for installation -rescan Tell Qtopia to rescan for new documents and applications
When applications are packaged for distribution to Qtopia devices, they reside in .qpk files that are specially made gzip'd tar files. In addition to the executable file itself, there also are the help files, multilingual translation files and the desktop entry. This desktop entry file contains elements to describe the name of the executable, the icon, what type of application it is and, finally, the MIME type to indicate what sort of data it can process.
Debugging our application on the Greenphone itself is fairly easy to set up.
First, we need to configure our build environment to cross-compile for the ARM architecture on the Greenphone:
Next, we need to rebuild our Makefile and executables, package them up and install them onto the phone:
qtopiamake -debug && make clean && make && gph -p -i -r -debug
At this point, we can click the arm-linux debugger icon on the desktop, open the example program on the phone and click run to execute it in the remote debugger.
A number of application deployment methodologies are available when developing with the Greenphone SDK.
First, we can build and run our applications so that they execute within the virtual machine's ersatz phone-like environment complete with a JPEG skin that looks like a phone sitting on your desktop. It is great for working out the GUI parts of an application, and it saves us the step of having to compile, flash on to the unit and debug remotely.
Second, applications can be compiled and packaged for the Greenphone, then run and tested on the device itself. As mentioned previously, the VM installs with a gdb debugger that can run inside the virtual machine and debug applications remotely on the phone.
Finally, we have “Phone bounce” mode, using the phone as a standard GSM/GPRS modem connected to the development machine via a USB cable. Our applications would run inside the emulator on the local machine, but would be joined logically to the real phone by whatever network link you have to it, such as a USB connection.
We do not have to customize the Greenphone in a piecemeal fashion. The Flash image representing the whole Greenphone Linux distribution on the phone can be updated using either the mini-SD Flash reader or the USB cable to re-install a complete new Linux distribution along with all the applications and configuration files. This makes it easier for enterprise use where items such as standard configuration options are set to enable things like corporate branding with visual themes, VPN settings, default address-book entries and localization settings, among others.
|Nativ Disc||Sep 23, 2016|
|Android Browser Security--What You Haven't Been Told||Sep 22, 2016|
|The Many Paths to a Solution||Sep 21, 2016|
|Synopsys' Coverity||Sep 20, 2016|
|Naztech's Roadstar 5 Car Charger||Sep 16, 2016|
|RPi-Powered pi-topCEED Makes the Case as a Low-Cost Modular Learning Desktop||Sep 15, 2016|
- Android Browser Security--What You Haven't Been Told
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Nativ Disc
- The Many Paths to a Solution
- Naztech's Roadstar 5 Car Charger
- Synopsys' Coverity
- RPi-Powered pi-topCEED Makes the Case as a Low-Cost Modular Learning Desktop
- Securing the Programmer
- Glass Padding
- Identity: Our Last Stand
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide