Setting up Qt Creator to work with Nokia N9

    This post participates in the contest " Smart Phones for Smart Posts " and in it I want to talk about setting up application development tools for MeeGo Harmattan, the operating system of the new Nokia N9 phone. We will configure on Windows Vista (I think that for the more popular Windows 7 the differences will be insignificant). The documentation for developers for Harmattan mainly lists Linux, so this article will be a good addition for developers who prefer or for some other reason use Microsoft operating systems.


    Preliminary


    To configure, we only need:
    1. Qt SDK update 1.1.4
    2. Nokia N9 phone with an Internet connection

    Before starting the setup, I recommend uninstalling the previous version of the Qt SDK, if you had one. My first attempt to install the tool chain was Qt SDK 1.1.3, and when I upgraded to a newer version, I could not get the desired result. The emulator did not work, and the installation of the application on the device failed.

    Customization


    1. Configuration starts by installing the Qt SDK. When installing this software product, I did not turn on the tool chain for Symbian, I used only the configuration for Harmattan, and that was enough for me. The most important points are shown in the screenshot. Then everything is standard: "Next> Next> Finish." (pictures are clickable) 2. When the Qt SDK is installed, go to the phone settings. To do this, enable the "developer" mode. I note that this mode is best included only at the time of development, since it increases the vulnerability of the system. To enable this mode, open “Settings> Security> Developer Mode” and enable this mode.








    The operating system will notify you of the possible risks, install the necessary packages and reboot. Although I have Debugging, Networking, and Utilities installed, all of this is not necessary. The main thing is that after a reboot, the Connectivity SDK appears in the main menu of the phone, which we will need in the next step of the network connection configuration.

    3. We recommend that you manually configure the network. At least, such a method is described in the Qt blog, which remains a mystery to me, because it is not difficult to raise a DHCP server on Linux (which is Harmattan), and this part could be easily automated. Two types of connection can be selected to configure the network:
    a. USB wired connection.
    b. Wireless connection using WiFi.

    I used a USB connection for my experiments. To configure the connection, you must first connect the phone to the computer and select "SDK mode" on the phone, and then open the "Network and Sharing Center." In the window that opens, on the right, click "Manage network connections", a browser window will open in which your network connections will be listed. One of these connections will be tied to the Nokia Ethernet / RNDIS based Device network adapter - this can be checked in the network connection properties. When the necessary network connection is found, proceed to its configuration. To do this, we will need to set a static IP address with a subnet mask. To do this, select the IPv4 protocol in the connection properties window and click "Properties", after which we set the necessary values, as shown in the screenshot,



    4. After the steps described above, a local area network connection will be created between your computer and phone. It remains only to configure Qt Creator to work with a mobile phone. To do this, open it, go to the menu "Tools> Options> Linux-devices." After that, click "Add Configuration". We select a new configuration for "MADDE-enabled devices" and run the configuration wizard. In the wizard window, enter the configuration name - in my case, “Nokia N9” (the name is arbitrary, I chose the name of the phone). It is also important to verify that the “Real device” option is selected. All other parameters are left unchanged.



    Qt Creator uses SSH connections to gain access to the phone, so on the next page the configuration wizard offers to generate authentication keys. We choose the answer “No” because we are creating the connection for the first time. On the next page, we select to create a new key pair, select the directory in which we want to save the keys, and click "Create". Configuring SSH keys is completed, now we proceed to the phase of transmitting the key to the phone. At this stage, you must carefully follow the instructions described on the last page of the wizard: a. Connect the phone in the "SDK mode". b. Open the SDK Connectivity app. c. Select the type of connection (in my case, USB).







    d. A password will be offered on the phone screen, which must be entered into the Qt Creator configuration wizard.
    e. After that, click "Install Key" and "Next." On this configuration is completed. 5. The final step is to verify that the configuration is working. To do this, create a test project: open the menu "File> New file or project", select the project type Qt Quick application (I think this is the best technology for developing simple applications for Harmattan). Next, follow the instructions of the wizard to create a new project. I selected a project with elements specifically for MeeGo Harmattan and a default icon.











    6. After creating the project, it remains only to select the active Harmattan configuration and click the “Run Project” button. Qt Creator will assemble the project, create a Debian package, copy it to the phone, install and run the application. Then you can see it running on its Nokia N9. In the end, I want to mention the work done by the Qt team. I believe that now the development tools for Harmattan are quite functional, and they can and should be used to develop their projects. (I developed applications using Scratch-Box, and it was far from so simple and convenient). I hope that this article will be useful and will help those who were going to start their project, but did not dare to take the first step. It seems to me that now it's easier than ever to do it.





    PS In order to remove the installed application, you need to go to "Settings> Applications> Application Management".

    useful links


    1. Harmattan Developer Library
    2. Qt Documentation

    Also popular now: