setting up the environment deploying the application on ... · nokia qt sdk leverages the power of...

22
Nokia Qt SDK Setting up the Environment & Deploying the Application on Nokia N900

Upload: phamkhuong

Post on 03-Jul-2019

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

Nokia Qt SDK

Setting up the Environment &

Deploying the Application on Nokia N900

Page 2: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

Index

1.0 What is Nokia Qt SDK ?

2.0 Establishing the connection between N900 and PC

3.0 Setting up th environment for N900.

4.0 Installing Qt Mobility API's

5.0 Setting up Qt-Creator for Remote Device(here N900)

6.0 Configuring Connections in Qt Creator

7.0 Running a Qt Application on Simulator

8.0 Running the Qt Application on Device

Page 3: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

1.0 What is Nokia Qt SDK 1.0 ?

Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline the creation of applications for Symbian, Maemo, and the forthcoming MeeGo platform. This allows you to build Qt applications and test them on device without actually taking the complicated procedure of creating the source package and making a debian out of it then deploy your application on the device.

1.1 Where can you get it ?

Nokia Qt SDK installer comes in two variants : Offline installer and Online installer

• Linux ( 32/64 bit)• Windows ( 32/64 bit )• Mac beta

Download SDK from here

1.2 Prerequisites

• Windows XP Service Pack 2 / Windows Vista / Windows 7• (K)Ubuntu Linux 7.04 32 bit or 64 bit with the following required

components

g++ make libglib2.0-devlibSM-dev libfontconfig1-dev libxrender-devlibxext-dev libfreetype6-dev libx11-devlibxcursor-dev libxfixes-dev libxft-devlibxi-dev libxrandr-dev libgl-dev and libglu-dev

(if using QtOpenGL)Reference Page

To install the above packages type following command on terminal : apt-get install <package-name>

To install all in one command write each package name seperated by a space.

Page 4: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

1.3 Installation

I hope you have already downloaded the SDK installer of your choice if not refer section 1.1

• Windows PlatformDouble click the downloaded “.exe” file and rest will be guided by the installer.

• Linux By default execute permission is not set for the downloaded file.To make the file executable follow the steps mentioned below :

1. open terminal2. change to the directory where you have downloaded the installer

my download directory is /home/qt/Desktop so i'll type$cd /home/qt/Desktop

3. Now it's time to make installer executable type chmod 755 <file name>my download file name is Nokia_Qt_SDK_Lin32_offline_v1_0_en

$chmod 755 Nokia_Qt_SDK_Lin32_offline_v1_0_en

4. Now type ./Nokia_Qt_SDK_Lin32_offline_v1_0_en(or you can double click it after browsing to the file)

5. Rest will be guided by the installer (if you have problem in installation Click here)

2.0 Establishing the Connection b/w N900 and Development PC

Hardware and Software RequirementsTo 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.

• 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.

Page 5: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

3.0 Setting up the Environment for 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.

1. On the Nokia N900, select Application Manager > Download > Development > mad-developer to install the Mad Developer software package.

2. It will take a while to download and install.

3. Now you will get an icon of mad-developer in main menu. Click Mad Developer to start the Mad Developer application.

4. Click it to setup the N900. (Screenshots are given after a while)

Set IP: 192.168.2.15

Netmask: 255.255.255.0

5. Click developers Password to get a random generated password for current session* , and this password will be needed further by Qt to synchronize the development PC and N900.

(* If you close the Qt window or reboot the device the password expire you need to regenerate a new password)

Page 6: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

3.1 Step By step Screenshots

NOTE:- All screenshots are taken according to author's device, position may change in users environment. (the number associated with each picture signifies the step number explained abobe and it's sub steps)

1a) Open main menu select application manager (Lower Left corner)

1b) Select Download( Hope it's easy one to find)

Page 7: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

1c) Select Development (First row 4th icon)

1d) Select mad-developer(Last column)

Page 8: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

2a) Accept the Agreement and click continue, now it 'll start downloading and you can have a coffee if the internet connection is slow otherwise it's just 2.6 MB package.

Now we move on to step3) As you can see Mad developer icon in last row 4 th item .Click to launch the

application

Page 9: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

4a) Click Edit to set up the USB

4b) Set IP specified in figure and Netmask too, then click Configure

Page 10: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

Now if every thing is going absolutely fine then your window should look like this.5a) Select Developer Password you will get the window with the password as shown in next picture.

5) Here the randomly generated password is “ujxnhe” .

WARNING: Do not close mad-developer on the device or else connection will be lost.

Page 11: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

Now your mad-developer environment is ready in N900

Just one more step to go

4.0 Installing Qt Mobility API's To develop applications that use the Qt Mobility API's, you must install the API's on the devices. The API's are not available in the Nokia N900 package manager, and therefore, you must install them from the command line as the root user.

1. 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 install Qt Mobility libraries, enter the following command: apt-get

install libqtm-* 4. To confirm the installation, enter: Y.5. Close the terminal.

Screenshots for above steps

1) Open menu and select X Terminal, you'll be directed to a built in terminal

Page 12: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

2) First type sudo gainroot to become root user.3) To install Qt-Mobility API's type the command apt-get install libqtm-*

5.0 Setting up Qt-Creator for Remote Device(here N900)

1. First you need to install MADDE tool which provides an interface to internal programs to run application in the device (i.e. Nokia N900)

2. NO need to worry; this tool comes with the Nokia Qt SDK you just need to set path for the executables in your .profile/.bashrc (in BASH shell) please see the similar files if you are using other shell

3. <SDK Install Dir>/Maemo/4.6.2/bin then export the path.For example i installed SDK inside “/home/qt/NokiaQtSDK/” so i added path something like this:

/home/qt/NokiaQtSDK/Maemo/4.6.2/bin:$PATH ; export PATH

4. You can do it in following way1. Open the terminal type gedit .profile( or type ~/.profile)2. Then add the line in above step 33. Save and exit the editor4. Now all you need to do is rerun your profile by typing . .profile in terminal this command runs your .profile file without logging out

Page 13: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

5. You can check the newly added path in the PATH variable. Type $echo $PATH in the terminal and you can see newly added path.

Screenshots for above steps

1) Edit the .profile file type gedit .profile (being in your home directory)

2)Now add /home/qt/NokiaQtSDK/Maemo/4.6.2/bin:$PATH ; export PATH to the .profile file.

Page 14: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

You can add multiple path using : (colon) as a seperator as in above case i have added Qt 4.7 path then the path of our interest.

6.0 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.

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 the Qt Creator Manual.

For the simplicity let's just focus creating the connection using Password.

6.1 Connect the Remote Device using USB connection  

1. Connect the device using USB cable and select PC Suite Mode on the device.

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.

Page 15: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

2)Enter the command in the development PC'c terminal this will set the IP of PC for usb0 as 192.168.2.14 sudo ifconfig usb0 192.168.2.14 up (repeat this every time you reboot your host PC)

3) Now open the Qt Creator and select Tools > Options... > Projects > Maemo Device Configurations > Add, and add a new configuration for a Remote device.

You Should get the above screen; Click Add

3)Fill the options according to instructions below

Name of your choice, i gave N900 Device Type as Remote Device Authentication Type as Password make sure the Host Name field is having this -> IP 192.168.2.15Ports SSH: 22 and GDB server: 10000

(about GDB server : It stands for “GNU Project debugger” -> GDBSERVER is a program that allows you to run GDB on a different machine than the one which is running the program being debugged. )

Connection timeout: default value is 30 sec, you can give any value.

Username: the name you have given during the installation of mad-developer on N900 i had kept it default so mine is developer

Page 16: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

Password: Here type the password generated by mad-developer on the device for current session(remember: you need to generate password everytime you close QtCreator )

After correctly following steps in section 6.1; Qt Creator option window(the window in which you were working) should look like below:

4) Now click the Test button to check the connection, you should get a window like the one below

If you get the Device Configuration Test window like this then everything is well and good. you are all set to go!! (if not the check where you went wrong).

Page 17: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

7.0 Running a Qt Application on Simulator

After all connection setups have taken place, select a Qt project to run.

Select all the targets in the Project Setup window.

Page 18: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

7.1 Running on Maemo Simulator.

Simulator will be selected by default on opening the project.

Build the Project and Run.

Page 19: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

You will see the Virtual Nokia N900[Maemo Simulator] on your Desktop.The Qt Application will be running in the Virtual N900.

You can test the app,how it would look,behave and work in the Actual Nokia N900.Explore the Options given in the Options panel of Maemo Simulator.

Page 20: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

8.0 Running the Qt Application on Device

Make sure the device is connected to the Development computer and set up with Qt Creator as mentioned from section 2.0 to 6.1.

Select any Qt project to run.Select all the targets in the Project Setup window, as explained above.

Now, Click on Projects icon on the Left pane of Window.

Select Maemo on the top pane, which shows settings for each target. After that, Click on Build.

Now in this Build Settings for Maemo, Select Qt Version.

Page 21: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

In this Drop down menu, Select 4.6.2.

Now click on 'Run Settings' of Maemo Build Settings.In the Run Configuration Name field, Provide a name, ex : Animated Tiles.Make sure Device Configuration is Nokia N900.

That's all the settings you need to make.

Page 22: Setting up the Environment Deploying the Application on ... · Nokia Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline

Now Build the project by clicking the Build Icon.After Successfully building, Click on Run icon.And, Voila ! The App is running on Your Nokia N900.

After Running this, the Debian Package of the application is found on development PC in the Location : <Projectname>-build-maemoEx : Debian Package for this project could be found in 'animatedtiles-build-maemo' directory in the development PC.

Also the Deb Package of the application is found in the Nokia N900 device in location : /home/developer/

Report byAfaque HussainKumar Vaibhav

Nokia India Pvt. LimitedBangalore,India.