Author Archives: admin

Quick first steps – qtbubblelevel 2D

Recently updated QML projects showcase encouraged me to start learning more about QML. Two examples gathered my attention especially. The first of them is the Bubble Level application which uses the accelerometer reading to provide a leveling tool, and another a really cool game called Quick Hit.

As the latter has rather complicated structure with animations, multiple windows and plugins, I’ve left it for ‘dinner’ and started looking into the leveling app. I first looked into the “BubbleLevel.qml” file which was indicated as the UI starting point. The structure of the UI is very simple and I’ve found myself quickly around the controls’ definitions. Most of them have the typical height/width/anchors/margins attributes for quick UI creation. Additional features include function call on the event like:

onClicked: bubbleLevel.minimizeApplication()

where “minimizeApplication()” is the public SLOT in the app definition, so binding the QML UI with CPP functionality is extremely easy.

One of the puzzling elements was the definition of some UI elements. Some of them like “Image”, “MouseArea” or “Flipable” are already defined in the framework, others are defined in a separate file provided by the application like “Tube” and “Button”. It seems that the name of the control is taken directly from the qml file name so the Tube is defined in the Tube.xml file and Button in the Button.xml file respectively.

While there’s a lot more to learn about the UI in this app, I thought to extend it’s functionality to ^2, by adding the second dimension to the bubble movement. So in the first place I created/modified the graphic resources to support the second dimension. These include:

  • air bubble (is more or less round now)
  • tube (now became something like a football pitch)
  • vertical shadow
  • vertical scale

Notice that new files need to be added to the .qrc resource file.

To support the new dimension I had to look into the C++ code where the accelerometers readings are fetched. The function provides already 3 readings, so I didn’t have to modify it, just add the “y” dimension to the rotationChanged signal (now watch out, in case of Maemo the “y” axis has to be inverted to work in the same manner as the “x” axis; for Symbian it’s yet to be checked, as I couldn’t install the Qt 4.7.1 on my test phone yet). This started a chain of inconsistencies, as the SLOT connected to this signal needs to be changed. These connections are defined in the main.cpp file so tracking them down didn’t cause much trouble. There were also two functions from the settings.h which needed another argument, and these are saveCorrectionAngle and correctionAngle.

When the application was already compiling I launched it and of course didn’t work yet, because the necessary QML bindings were not defined for the second dimension. Moreover the bubble stopped moving as the functions were not compatible anymore. Luckily running the application in the Qt Simulator or from the Shell Console on Nokia N900 you can see the debugging messages. In this case they helped to localize the mistaken bindings.

// Signaled when correction angle is saved
signal saveCorrectionAngle(variant angleX, variant angleY)

// These functions are used as Qt slots
function handleRotation(degX, degY) {
horTube.rawangleX = degX
horTube.rawangleY = degY
}

function setCorrectionAngle(degX, degY) {
horTube.angleconstantX = degX
horTube.angleconstantY = degY
}

Now a bit more (but still not too much) work was needed to modify the Tube behavior. When the new readings are set to the tube, only the item’s property rawangleX/Y change and the position is updated automatically. With the new dimension, we had to add the new function to calculate the variation of the bubble from the center of the tube. The original behavior was to reach the limit of the tube every 20 degrees horizontally (this was defined in a bit obscure way; the order of “/” and “*” operations was hard to guess), so we I did the same for the vertical axis.

The final refinements included changing buttons anchors

top: parent.top
 //verticalCenter: horTube.verticalCenter

and changing the tube’s height to the actual proportions occupied on the background image

width: parent.width * 0.775; height: parent.height * 275/480

There was a problem running the example on Symbian phone due to unavailability of the qt libraries (also qt_installer.sis from the SDK failed for some security reason) but let’s hope this get fixed in the nearby future.

Here is the modified source as well as the installation packages:
QtBubbleLevel.sis (Symbian^1)

QtBubbleLevel_installer.sis (Symbian^1 with smart installer)

qtbubblelevel_1.3.0_armel.deb (Maemo)

qtbubblelevel-1.3.0-1.i586.rpm (MeeGo)

qtbubblelevel_2D-src.zip (source code)
As you can see, there’s also an extra package for MeeGo device. It’s neither compliant with the Intel AppUp specification nor fully functional (the bubble doesn’t move but it’s hard to say why at this stage). But the package can be installed properly, the icon is available on the desktop, and all the QML is rendered as expected.

So these were the only changes needed to have the working 2D example. I must say that’s much cooler to show to a friend in a pub and to test his/hers ability to level properly after a pint 😉
But also imagine you can now apply this example to the game for steering.

Why do we need Symbian Ideas?

(originally published at http://blog.symbian.org/2010/02/19/ideas-at-mwc/)

I’ve spent the Tuesday morning two weeks ago volunteering in the ideas.symbian.org lounge at the Mobile World Congress in Barcelona. The place, full of soft pouffes, maintained in yellow-white-black design, and also decorated with huge bath-ducks (that’s a Symbian’s mascot these days) attracted many business people, who either wanted to rest for a while with a tasty-yet-free coffee (the bartender didn’t share recipes, so no open-source here, Symbian 😉 ), have a little chat in this quieter place, or just use the free WiFi access.

Having an opportunity to talk to some of them I tried to inquire for ideas they could share with Symbian to improve future devices and our experience with more and more capable smartphones. That’s no surprise that among people who visited the lounge many used Symbian (and in particular Nokia) phones for a while, but abandoned them for the sake of BlackBerries or iPhones. The very common words repeated in these talks were that these competitors bring speed, simplicity of the software (watch the huge scrolling menus) and intuitiveness (shall I mention kinetic scrolling yet?).

There were of course some hardcore Symbian users or partners, who had very precise ideas what they need from the platform, and knowing where it’s going they just wanted to take advantage of the new business opportunity.

Someone mentioned he would like to have Symbian extensible for embedded platforms. I imagine he could use it for his own brand coffee machine, radio or something else yet (i.e. have you seen the QT-based coffee machine? http://twitpic.com/l8yzz).


Other idea was referring to more flexible software payment framework. The developer could charge for the software usage rather than for downloading it from the Ovi store (that would boost the number of freeware applications, and let the user choose more wisely, depending on how they actually like the application, instead of a quasi-blind shoot, based on the last comments, description and a couple of screen shots…).

There was also some interesting vote from the person who actually worked with Nokia, and couldn’t understand why there is no profile scheduler anymore (that’s something that sets your phone to silent automatically everyday from 10pm to 7am). I was able to help with the software I used in the past (feel free to try it yourself at http://www.drjukka.com/ ). And that’s good that Symbian allows the independent developers build additional features, but I don’t see any reason why the top-shelf phone like Nokia N97 shouldn’t come up with that feature built in! I remember this was available in Nokia DC4 business phones like 8310 or 6310i. OK, for now problem solved. But then again, if someone has been fighting so long to allow fair usage of Internet browsers in Microsoft Windows (in Europe Microsoft is supposed to show the screen to choose one of the alternative browsers at the first use), why shouldn’t we do the same with Symbian? All the necessary applications should be built in, but with possibility of replacing them with our favorites (this also applies to the contact list, web browser, calendar, etc.).*


A resume of interesting ideas seen this day:

Idea 1: Make my email as easy and as intuitive as in Blackberry (there are so many solutions: default messages application, Nokia email from http://email.nokia.com/, custom clients like Gmail Java application, Mail for Exchange, but I cannot say I stayed with one of them because it fulfilled my needs)

Idea 1.1: Give me the scroll/touch panel of BB to allow quick navigation (isn’t it a patent though?)

Idea 2: Allow for the after-Ovi-store payments (as a framework for the application)

Idea 3: Use phone as GPS, and introduce the toll device built-in!

Idea 4: Make my shopping list intelligent (count the days after we have to buy the same product: milk, bread, corn flakes, fish) and adaptable (scan the bar code and add it to a product list?)

Idea 5: More battery life (really, and something like 2 weeks at least; remember that we don’t wind up watches since at least the early 90’s…)

Idea 6: Give me back my profile scheduler!

Idea 7: Make my Internet connection stable and easy to set up (this applies to constant querying for the access point, especially in the add-on platforms like Java or WRT).

Conclusion that comes to me after this day is that ideas.symbian.org, although seems to be a gate to ground-breaking features of the future, rather shows where Symbian is these days. What I wrote here is just a fraction of the ideas already placed on the website, but maybe it will work as a therapy for the platform development. Because the first step in learning is to acknowledge and not stay in denial.

*Correction. There’s an option to change default applications in my Nokia 5800. It’s in the Settings>Phone>Application Settings > Default apps. But so far I couldn’t make use of it.


Notes from the Nokia – Maemo conference

Maemo community visited Barcelona last weekend, giving us a chance to have a peek at the newest Nokia’s N900 device and also learn something about the software creation for this up and coming competitor on the mobile market.

The event lasted 3 days on 4-5-6 of December 2009. The first day was mostly dedicated to lectures and presentations Two following brought some more insight to the Maemo software creation, and even some real programming occurred.

Quim Gil – the event organizer – and Jose Luis Martinez – vice president for Nokia’s N-series – gave the first speaches presenting the N900 device to the public. Local community could definitely be pleased having these important members of the Nokia team working also for them. Many lectures were lead in Spanish. This definitely helped some of the local attendees with understanding the topic, but it didn’t end up without confusion. People coming from other countries were rather expecting the event to be covered English than in this “Espanglish” mixture, which it ended up. Finally Spanish/English speaking experts were available at the lab/hacking sessions.

The event consisted of parallel sessions for the software creation, documentation and localization. There were a few last-minute changes in the agenda, so I’m not sure if they all happened as planned, but there was a choice of the classes, and the amount of information that I managed to receive was just enough. Coming from the Symbian community, my main concern was to get introduced to the Qt programming, and start creating and deploying it also on the new Maemo devices.

Aleix Pol and Jesus Sanchez-Palencia introduced some new Qt APIs, and were then attending programmers individually at the hacking session. That was a really good experience to work with them, and even though Qt seems to be a well structured and easy-to-learn environment, their help was essential. If you want to try them yourself, it would be good to start with some examples.

Daniel Wilms from Nokia presented some new tools for cross-compilation, which will help creating software for the N900 and future Maemo devices even quicker, and easier. But the environment for  the device emulation and software creation still needs a few hacks to set it up on the computer. If I started configuring the ‘scratchbox’ myself, I’d probably only get the scratchhead effect, as the installer still fails at some stages that are a mystery for the average user.  At least the basic knowledge of the aptitude software management, and the batch shell in Linux comes handy then. Hopefully obstacles will disappear from the installing process, but it’s worth to give it a try anyway. If the installer from the Forum Nokia website fails, try to read some hints on the Maemo Documentation website.

Finally the best and the funniest lecture was given by Patricia Montenegro from OpenBossa. The topic of relations between graphic designers and developers seems to have a good comedic potential, and while presented attractively was a real hit on the conference. There are some videos from the previous presentations, but the one from the conference in Barcelona was way better somehow. To find more try to search for UI from a broken home: The relationship between developers and designers.

Thanks for the good time spent with the Maemo programmers and zealots at Barcelona (actually Cornella) Citilab!

and some twitter profiles worth following:
Maemo community visited Barcelona last weekend, giving us a chance to have a peek at the newest Nokia’s N900 device and also learn something about the software creation for this up and coming competitor on the mobile market.
The event lasted 3 days on 4-5-6 of December 2009. The first day was mostly dedicated to lectures and presentations Two following brought some more insight to the Maemo software creation, and even some real programming occurred.
Quim Gil – the event organizer – and Jose Luis Martinez – vice president for Nokia’s N-series – gave the first speaches presenting the N900 device to the public. Local community could definitely be pleased having these important members of the Nokia team working also for them. Many lectures were lead in Spanish.  This definitely helped some of the local attendees understanding the topic, but it didn’t end up without confusion. People coming from other parts of Europe were rather expecting the event to be covered English than in this “Espanglish” mixture, which it ended up. Finally Spanish/English speaking experts were available at the lab/hacking sessions.
The event consisted of parallel sessions for the software creation, documentation and localization. There were a few last-minute changes in the agenda, so I’m not sure if they all happened as planned, but there was a choice of the classes, and the amount of information that I managed to receive was just enough. Coming from the Symbian community, my main concern was to get introduced to the Qt programming, and start creating and deploying it also on the new Maemo devic