using the QBluetooth library with Symbian S60 5th EditionPublicado; 15/01/2011
recently, I started studying Symbian development with Qt. I even developed myself a few apps and, comparing to Symbian C++, I must say, it’s as lot easier. the Symbian C++ idiosyncrasies are a headache if you don’t have a strong basis. and I still don’t have it. or, as the wikipedia says:
Unfortunately, Symbian C++ programming has a steep learning curve, as Symbian C++ requires the use of special techniques such as descriptors, active objects and the cleanup stack. This can make even relatively simple programs harder to implement than in other environments.
the community itself recommends Qt for simple apps development, and Symbian C++ for lower level apps. even Nokia is giving increased support to Qt as Symbian development platform; a proof for that is the lauching of the Nokia Qt SDK, a full suite for Symbian development with Qt. much simple than the though Symbian C++, IMO.
playing around with it, I wanted to develop an app for my Symbian phone using some bluetooth for communication with another equipment. I found myself surprised after discovering that there wasn’t a official project putting together bluetooth, Qt and Symbian; usually, the devs out there do it with Symbian C++ for this kind of app.
after some search, I found the QBluetooth project page, which aims the creation of a Qt bluetooth library for Symbian. after a little time pulling my hair out to configure it right, I’ll post right down here the followed step-by-step I did to make things work.
if you want to start downloading things already, here’s the list:
- ActivePerl 126.96.36.1995; (rapidshare link; the original link is not available at Nokia’s site anymore)
- S60 5th Edition SDK; (you’ll need to go to “Download version for” and select “5th Edition (622 MB)“);
- Qt libraries 4.7.1 for Symbian;
- Qt Creator 2.0.1 Binary for Windows;
- Extensions Plug-in for S60 3rd Edition SDK for Symbian OS, Feature Pack 2, v1.3;
- QBluetooth; (28/dec/2010 version)
there are some considerations to be made about these tools:
- I’m developing for Symbian S60v5 so things will change if you’re using a different version;
- I tested the configuration posted here, but problems may occur depending on your environment;
- I’m using Windows XP SP3;
- every time I could, used the installation defaults; additional configs will be informed; however, always read any information that it may shows up;
- I used a lot of information available on the QBluetooth official page. in case of any doubt, use the comments or the project forum.
installing the tools
1) start with ActivePerl-188.8.131.525-MSWin32-x86.msi. just execute and select the defaults;
2) extract the contents of the file MinGW-gcc440_1.zip in C:\
3) extract the contents of the file S60_5th_Edition_SDK_v1_0_en.zip and execute the file S60_5th_Edition_SDK_v1_0_en\setup.exe . install it without modifying any option. after a while the wizard will ask for installing the CSL ARM Toolchain; choose “accept” and install it as well.
4) install the Qt 4.7.1 for Symbian, executing the file qt-symbian-opensource-4.7.1-s60.exe . the wizard will show a window referencing the S60 5th Edition SDK installation folder.
5) install the Qt Creator 2.0.1, executing the file qt-creator-win-opensource-2.0.1.exe . it will show some information about debugging stuff. ignore them and just select the defaults.
6) open the file S60_3rd_Ed_SDK_FP2_API_Plug-In_Pack_LLA_1_3.zip . inside it, you’ll see another file named BluetoothEngineAPI.zip . open this file; inside it, there are two folders: epoc32 and plugins. you’ll put these folders in the directory C:\S60\devices\S60_5th_Edition_SDK_v1.0\ (please note that these folders already exists in the destination; you’ll only merge their contents).
the file QBluetooth_lib.zip (28 dec 2010) already has a precompiled version of QBluetooth, located in the file QBluetooth_lib.zip, in the folder \QBluetooth\bin\epoc32\InstallToDevice\QBluetooth_selfsigned.sisx . however, if you want to compile your version of QBluetooth:
- extract the contents of QBluetooth_lib.zip to a folder wich full path doesn’t have any special character;
- ope the project QBluetooth\source\QBluetooth.pro with Qt Creator;
- compile it; it should not show any errors (but some warnings may occur)
the result of the compilation is a package called QBluetooth_0x2003328D.sis, and it should be in the folder QBluetooth\source\ . for more information about configurations concerning the QBluetooth compilation , please refer to the QBluetooth page.
installing the QBluetooth on your development environment
in this context, install is just make the QBluetooth visible to all you projects in Qt for Symbian. the easiest way I found to do this is copying the contents of the folder \QBluetooth\bin\epoc32\ to C:\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\ . please note that, inside the folder \QBluetooth\bin\epoc32\ there are three other folders: include, InstallToDevice and release. the folders include and release already exists in C:\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\ , so you’ll again only merge their contents.
compiling an example project
last but not least, lets compile the project QuteMessenger, provided as example by the QBluetooth crew. for that:
- extract the contents of the file QuteMessenger.zip to a folder witch address doesn’t have any special characters;
- open the project QuteMessenger.pro in Qt Creator;
- go to line 37 of the file QuteMessenger.pro; apparently, there is a little mistake; it shows:
when it should be
(please note the “$$” just before “(EPOCROOT)” )
- compile the project
and we’re done! install on you cell phone the application QuteMessenger.sis, located in the folder QuteMessenger after the compilation and do some visibility tests with another bluetooth device!