User:Kumarafaque

From KDE TechBase
Revision as of 13:01, 29 September 2010 by Kumarafaque (talk | contribs)

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


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.


Where can you get it ?

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

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


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-dev libSM-dev libfontconfig1-dev libxrender-dev libxext-dev libfreetype6-dev libx11-dev libxcursor-dev libxfixes-dev libxft-dev libxi-dev libxrandr-dev libgl-dev libglu-dev (if using QtOpenGL)

    Installation

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

    Windows Platform Double 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 terminal
    2. 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


    Establishing the Connection b/w N900 and Development PC

    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.
    • 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 link PC Connectivity on the Maemo web site. Download and install the latest PC_Connectivity_<version>.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 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

    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)

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

    1d) Select mad-developer(Last column)

    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.

    3)As you can see Mad developer icon in last row 4th item.Click to launch the application

    4a) Click Edit to set up the USB

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

    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.
    Note: User interface of mad-developer may differ.

    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

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


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

    1. 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. 1.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. 1.<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. 1.You can do it in following way
      1. Open the terminal type gedit .bashrc( or type ~/.profile)
      2. Then add the line
        • PATH=/home/qt/NokiaQtSDK/Maemo/4.6.2/bin:$PATH
        • export PATH
      3. Save and exit the editor
      4. Now all you need to do is rerun your profile by typing . .bashrc(or . .profile) in terminal this command runs your .profile file without logging out.
      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.

    Connect the Remote Device using USB connection

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


    1. 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)
    2. 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