📜 ⬆️ ⬇️

Configure 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. The settings will be made on Windows Vista (I think that for the more popular Windows 7 the differences will be insignificant). The developer documentation for Harmattan mainly features Linux, so this article will be a good addition for developers who prefer or use Microsoft operating systems for some other reason.


Pre


For setup we need only:
1. Qt SDK update 1.1.4
2. Nokia N9 with internet connection

Before starting the configuration, I recommend removing the previous version of the Qt SDK, if you had one. When I first tried to install the tool chain, I had the Qt SDK version 1.1.3, and when it was updated 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 with installing Qt SDK. When installing this software, I did not include 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 setup. For this you need to turn on the "developer" mode. I note that this mode is best included only at design time, as 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 possible risks, install the necessary packages and reboot. Although I have Debugging, Networking, and Utilities installed, all this is not necessary. The main thing is that after rebooting, the SDK Connectivity appears in the main menu of the phone, which we will need in the next step of the network connection configuration.

3. Network configuration is recommended manually. At least, this method is described in the Qt blog, which remains a mystery to me, because it is quite easy to get a DHCP server up to Linux (which is Harmattan), and this part could be easily automated. To configure the network, you can choose two types of connections:
a. Wired connection using USB.
b. Wireless connection using wifi.

I used a USB connection for my experiences. To set up the connection, you must first connect the phone to the computer and select "SDK mode" on the phone, then open the "Network and Sharing Center". In the window that opens, on the right, click on "Manage network connections", a window of the explorer will open, which will list your network connections. One of these connections will be tied to the network adapter "Nokia Ethernet / RNDIS based Device" - this can be checked in the properties of the network connection. 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, in the properties window of the connection, select the IPv4 protocol and click "Properties", then set the required values, as shown in the screenshot, and click "Apply".



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



Qt Creator uses SSH connections to access 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, choose to create a new pair of keys, select the directory into which we want to save the keys, and click "Create." The configuration of the SSH keys is completed, now we are moving to the key transfer phase of the phone. At this stage, you should carefully follow the instructions described on the last page of the wizard:
a. Connect the phone in "SDK mode".
b. Open the application "SDK Connectivity".
c. Select the type of connection (in my case, USB).
d. The phone screen will offer a password that you need to enter in the Qt Creator configuration wizard.
e. After that, click "Set key" and "Next." At this configuration is complete.



5. The final step is to check the health of the configuration. To do this, we create a test project: open the “File> New File or Project” menu, select the project type Qt Quick application (I think this is the best technology for developing simple Harmattan applications). Next, follow the instructions of the wizard to create a new project. I chose a project with elements specifically for MeeGo Harmattan and the default icon.







6. After creating the project, all that remains is to select the active Harmattan configuration and click the “Run project” button. Qt Creator will build the project, create a Debian package, copy it to the phone, install and run the application. After which you can see it running on your Nokia N9.



In the end, I would like to mention the work done by the Qt team. I believe that now the development tools for Harmattan are quite efficient, and they can and should be used to develop your projects. (I developed applications using Scratch-Box, and it was not so easy 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 is easier to do.

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

useful links


1. Developer's library for Harmattan
2. Qt documentation

Source: https://habr.com/ru/post/133748/


All Articles