Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

Setting Up Development Environment for Maemo

Maemo is a software platform developed by Nokia for smartphones and Internet Tablets. The Maemo SDK provides an open development environment for different applications on top of the Maemo platform. The necessary tools from the Maemo SDK are also included in the Nokia Qt SDK. The whole tool chain that you need to create, build, debug, run, and deploy Maemo applictions is installed and configured when you install the Nokia Qt SDK.

Maemo 5 is based on the Linux 2.6 operating system. For more information about the Maemo platform, see Software Platform on the Maemo web site.

For more information about developing applications for the Maemo 5 platform, select Help > Index and look for Platform Notes, or see Platform Notes - Maemo 5.

Hardware and Software Requirements

To build and run Qt applications for Maemo, you need the following:

  • Nokia N900 device with software update release 1.2 (V10.2010.19-1) or later installed.
  • MADDE cross-platform Maemo development tool (installed as part of the Nokia Qt SDK).

    For more information about MADDE pertaining to its installation, configuration, and deployment on the device, see Introduction to MADDE.

  • Nokia USB drivers.

    Only needed if you develop on Windows and if you use a USB connection to run applications on the device. The drivers are installed as part of the Nokia Qt SDK. You can also download them from PC Connectivity on the Maemo web site. Download and install the latest PC_Connectivity_<version>.exe (at the time of writing, PC_Connectivity_0.9.4.exe).

The Qt Creator/MADDE integration is supported on the following platforms:

  • Linux (32 bit and 64 bit)
  • Windows (32 bit and 64 bit)

Note: The only supported build system for Maemo in Qt Creator is qmake.

Setting Up the Nokia N900

You can connect your device to your development PC using either a USB or WLAN connection.

For the device, you need to use a tool called Mad Developer to create the device-side end point for USB and WLAN connections. It provides no diagnostics functions but is essential for creating connections between the device and your development PC.

To use a WLAN connection, you must activate WLAN on the device and connect it to the same WLAN as the development PC. The network address is displayed in the Mad Developer.

To use an USB connection, you need to set up the Nokia N900 as a network device on the development PC.

Note: If you plan to connect your development PC to the Nokia N900 only over WLAN, you can ignore the USB-specific parts in the following sections.

Installing and Configuring Mad Developer

Install Mad Developer on a device and configure a connection between the development PC and the device.

To install and configure Mad Developer:

  1. On the Nokia N900, select Download > Development > mad-developer to install the Mad Developer software package.
  2. Click Mad Developer to start the Mad Developer application.
  3. To use a WLAN connection, activate WLAN on the device and connect to the same network as the development PC. You can see the network address in the wlan0 field.
  4. To use an USB connection:
    1. If you are using Microsoft Windows as development host, you must change the driver loaded for instantiating the connection. In the Mad Developer, select Manage USB and select Load g_ether.
    2. To set up the USB settings, click Edit on the usb0 row and confirm by clicking Configure.

      Note: By default, you do not need to make changes. The usb0 row displays the IP address 192.168.2.15.

  5. Select Developer Password to generate a password for a freshly created user called developer. The password stays valid for as long as the password generation dialog is open. You enter the password when you configure the connection in Qt Creator.

Installing Qt Mobility APIs

To develop applications that use the Qt Mobility APIs, you must install the APIs on the devices. The APIs are not available in the Nokia N900 package manager, and therefore, you must install them from the command line as the root user. To become the root user you must first install rootsh from the application manager.

  1. On the device, install rootsh from the Application Manager.
  2. In Programs, select X Terminal to open a terminal window.
  3. To switch to the root user, enter the following command: sudo gainroot
  4. To install Qt Mobility libraries, enter the following command: apt-get install libqtm-*
  5. To confirm the installation, enter: Y
  6. Close the terminal.

Setting Up Network Connectivity on Development PC

Use the network configuration tools on your platform to specify the connection to the device on the development PC. You need to do this only if you use an USB connection.

Linux

The device uses the IP address 192.168.2.15 with the subnet 255.255.255.0 for its USB connection by default, so you can create the network interface with a different address inside the same subnet too.

Note: If you have changed the IP address of the device when configuring Mad Developer, you need to reflect those changes in your development PC USB network settings.

Run the following command in a shell as root user: ifconfig usb0 192.168.2.14 up

Windows

When you connect the device to your Windows PC, Windows tries to install a driver for the Linux USB Ethernet connection. In the Found New Hardware Wizard, select No, not this time in the first dialog and Install the software automatically in the second dialog.

To specify a network connection:

  1. Open the Network Connections window.
  2. Select the Linux USB Ethernet connection that is displayed as a new Local Area Connection.
  3. Edit the Internet Protocol Version 4 (TCP/IPv4) properties to specify the IP address for the connection. In the Use the following IP address field, enter the following values:
    • IP Address: 192.168.2.14
    • SubnetMask: 255.255.255.0
    • Default gateway: leave this field empty

Depending on your version of Microsoft Windows you may have to unplug and re-plug the Nokia N900 to reload the driver with its configuration accordingly.

Setting Up MADDE

If you install Nokia Qt SDK, the MADDE package is installed and configured automatically on your development PC and you can omit this task.

  1. Download the MADDE installer file for your platform from the MADDE site.
  2. Execute the installer and follow the instructions.
  3. To see which targets are available, run mad-admin list targets.
  4. To install the target that starts with the string fremantle, use the command: mad-admin create fremantle-qt-xxx
  5. In Qt Creator, register the MADDE tool chain:

    1. Select Tools > Options... > Qt4 > Qt Versions.
    2. Click , to add a new Qt version.

      The qmake Location is the qmake executable in <MADDE dir>/targets/<fremantle target>/bin.

When you have installed the target, you have a toolchain and a sysroot environment for cross-compiling.

Configuring Connections in Qt Creator

To be able to run and debug applications on the Maemo emulator and devices, you must set up a connection to the emulator and the device in the Qt Creator build and run settings. If you install Nokia Qt SDK, the necessary software is installed and configured automatically and you only need to configure a connection to the device.

By default, you create the connection as the developer user. This protects real user data on the device from getting corrupted during testing. If you write applications that use Mobility APIs, you might want to test them with real user data. To create a connection as a user, specify the Username and Password in Qt Creator. For more information, see Testing with User Data.

You can protect the connections between Qt Creator and the Maemo emulator or a device by using either a password or an SSH key. You must always use a password for the initial connection, but can then deploy an SSH key and use it for subsequent connections. If you use a password, you must generate it in Mad Developer and enter it in Qt Creator every time you connect to the Maemo emulator or to a device.

If you do not have an SSH key, you can create it in Qt Creator. Encrypted keys are not supported. For more information, see Generating SSH Keys.

To configure connections between Qt Creator and the Maemo emulator or device:

  1. If you install the Maemo emulator (QEMU) separately, you must specify parameters to access it:
    1. Start Mad Developer in the emulator.
    2. Click Developer Password to generate a password for the connection.
    3. In Qt Creator, select Tools > Options... > Projects > Maemo Device Configurations > Add to add a new configuration.

    4. In the Configuration name field, enter a name for the connection.
    5. In the Device type field, select Maemo emulator.
    6. In the Authentication type field, select Password for the initial connection.
    7. In the Password field, enter the password from the Mad Developer for the initial connection.

      You can use the default values for the other fields.

    8. Click Test to test the connection.
    9. To avoid having to specify the password every time you connect to the Maemo emulator, click Deploy Key... and select the file that contains your public key.
    10. When you have deployed the key to the device, change the configuration to use the SSH key for protection.

      The default location of the private key file is displayed in the Private key file field.

    If you installed the Nokia Qt SDK, a connection has been configured and you only need to specify the password and deploy the SSH key.

  2. To deploy applications and run them remotely, specify parameters for accessing devices:
    1. Connect your device to the development PC via an USB cable or a WLAN. For an USB connection, you are prompted to select the mode to use. Choose PC suite mode.

      Note: If you experience connection problems due to a USB port issue, switch to a different port or use WLAN to connect to the device.

    2. Select Tools > Options... > Projects > Maemo Device Configurations > Add, and add a new configuration for a Remote device.

    3. In the Host name field, enter the IP address from the usb0 or wlan0 field in Mad Developer.
    4. Specify the other settings in the same way as for a Maemo emulator connection.
    5. Click Test to test the connection.
    6. Click OK to close the dialog.
  3. To specify build and run settings:
    1. Open a project for an application you want to develop for your Nokia N900.
    2. Click Projects to open the projects mode.
    3. In the Build Settings section, choose the MADDE Qt version.

    4. In the Run Settings section, click Add to add a new run configuration.
    5. Set a name and select the device configuration.

      Note: You can either add separate run settings for both the Maemo emulator connection and the device connection or select the Device configuration before you run the application.

Testing with User Data

To run your application as the default user, you must first assign a password for the user account and then create the connection to the device as the user:

  1. On the device, in Programs, select X Terminal to open a terminal window.
  2. To switch to the root user, enter the following command: sudo gainroot
  3. To specify the password, enter the following command: passwd user
  4. In Qt Creator, Select Tools > Options... > Projects > Maemo Device Configurations.
  5. Specify the username user and the password in the device configuration.

Generating SSH Keys

If you do not have an SSH public and private key pair, you can generate it in Qt Creator. You can specify key length and the key algorithm, RSA or DSA. If you only use the keys to protect connections to the Maemo emulator or device, you can use the default values.

  1. Select Tools > Options... > Projects > Maemo Device Configurations > Generate SSH Key....
  2. Click Generate SSH Key.

    "SSH Key Configuration dialog"

  3. Click Save Public Key... to select the location to save the public key.
  4. Click Save Private Key... to specify the location to save the private key.
  5. Click Close to close the dialog.

Troubleshooting

The addresses used in this example might be reserved by some other application in your network. If you cannot establish a connection, try the following optional configurations:

usb0 in Mad Developer on DeviceUSB Network on Development PCHost Name in Qt Creator Build Settings

172.30.7.15 255.255.255.0

172.30.7.14 255.255.255.0

172.30.7.15

10.133.133.15

10.133.133.14

10.133.133.15

192.168.133.15

192.168.133.14

192.168.133.15

Note: You cannot use the value localhost for connections to a device.

Note: VPN connections might block the device connection.

X

rc="scripts/functions.js" type="text/javascript">
Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 53
  2. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  3. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtcreator-2.0
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web