Monday, July 25, 2011

Porting to Harmattan (2)

To recap, the issues I had earlier were:
1) VKB stays visible once launched.
2) App stays in landscape mode.
3) After a few launches, an empty toolbar showed up along the bottom of the screen and stayed there afterwards.

For (3), I found out it was due to setting the QDeclarativeView to showMaximized() instead of showFullScreen().

For (1), I couldn't figure out why TextInput element is not working probably. I tried changing to manually handling the focus, but still saw the same issue happening. In the end, I decided to apply a dirty trick. I simply set closeSoftwareInputPanel () method of TextInput elements when user clicks outside the TextInput fields, and further calling the method again when exiting the setting menu. Even with this ugly patch, flicking action on Stockona still sometimes invokes the VKB for no reasons.... again, the root cause is a mystery to me for now.

For (2), I have tried wrapping the QML into Qt components. At first, I tried wrapping my main QML page into a Page element, then push it into PageStackWindow. For whatever reasons, it didn't work. I then found out about the Window element. The documentation says it can wrap any QtObject and although the doc suggests not to use it directly, I found it worked for me.

The last thing I did today was changing the control button height so it's easier to click on them instead of clicking to the symbol list below.

At the end of the day, I made some progress but I am unhappy that I have little idea about the root causes of the various issues. Hopefully the community will figure out some commonly-good practices when using Qt components, and also the Qt documentation for Nokia's Qt components will improve with time.


PS - One thing worth noting is I found out it was super easy to set up N950 to connect to QtSDK by WLAN. Just fire the "SDK connection tool," then enter all the information in QtSDK and the deployment to device just works afterall. It greatly sped up the development time! (N900 probably supports this as well, but I remember you need to install some MADDE-related packages... I'm glad those packages are built into N950 by default.)

Friday, July 22, 2011

Porting to Harmattan (1)

Building the deb using QtSDK was pretty straightforward. All I did was install the experimental Harmattan components and removed stockona.pro.user so I could re-select targets.

However, the deployment was a little cumbersome. First, I need to change to root by:
devel-su, then type in password "rootme"

At first the system wouldn't install, later after some googling and try-n-err I found out it was due to me leaving the package manager running in the background. After installing the app, I could launch the app in terminal by the app name, without needing to pre-pend "run-standalone.sh" as in Maemo 5.

Then I found three blockers:
1) VKB stays visible once launched.
2) App stays in landscape mode.
3) After a few launches, an empty toolbar showed up along the bottom of the screen and stayed there afterwards.

I got the feeling that the software on N950 is a bit unstable because there are inconsistencies in the behaviors of Stockona. And since the camera app is not working on my unit, I decide to do a reflash and call it a day, or a night to be precise.

The good thing is, I found a bug in the app during the process.

Saturday, July 16, 2011

Introduction - How it started

Stockona is a stock quote app for Maemo5/Meego Harmarttan/Meego.

I had always wanted to develop something when I got my Nokia N900 (running Maemo 5) in early 2010. Unfortunately, the combination of GTK/Hildon/C and scratchbox development environment were too complicated for me to pick up so I never started. Time passed by and a lot of (bad) things happened in Nokia, but an important milestone came, and it was the release of QtSDK as the unifying dev tool for Nokia smartphones. Especially QML was touted as great tool to ease the pain of UI creation. It looked like Nokia finally started putting the pieces together, and then came the infamous Elopcypse on Feb 11, 2011.

I am no Nokia fan, in fact I don't like the brand. It was the openess and the deep linux root of Maemo 5 that attracted me to N900 instead of Google's Nexus. As a result, I wasn't bother by the news, just thinking I would never have a chance to touch this seemly wonderful toolset. But a few months passed, I read rumors about iPhone5 and started feeling it wouldn't be the phone that I had been hoping for. Meanwhile, I witnessed the wonderful things the Maemo community did to Maemo 5, and I started thinking maybe there's still a chance that I would buy a N9. I looked at the apps I used on Maemo 5, and thought what was lacking.... a really good stock quote app was one of them. Since I was a beginner to QT/QML, I spent several weeks to evaluate how hard it would be to develop such app. Thanks to referencing Tommi Laukkanen's wonderful apps, Twimgo and Newsflow, I was able to figure out the difficult network processing part and so the project started looking like it was feasible.

So my journey with QT/QML started in May.

Thanks to the power of QML+Javascript, the prototype was done rather fast. With the feedback from the Maemo community and the progress of two-month time, Stockona has grown a lot. Most of the improvements/features were done in QML, but I also started to use QT C++ more and more. As a result, my understanding to QT/QML also grows with experience. In the meantime, I was fortunate enough to get a  N950 (running Meego Harmarttan) from the Meego community. So I started this blog thinking I would like to share the QT/QML experience I learned (probably not so much from a professional developer's mind but from a end-user/amateur's mind), document the development of Stockona on Meego Harmattan, and talk about anything related to Qt/Meego/Open source model that are relevant to the my experience.

By the way, I haven't received my N950 yet.....