Finally in the store!

November 10, 2011 at 9:07 am | Posted in Uncategorized | Leave a comment

The Morse Player has finally gone into the store after several attempts. The biggest problem stopping the application from being accepted was the “equally functional in portrait and landscape mode” requirement.

Originally, this was solved, but then I put in a Morse Code table as an QML splash screen and as a menu item. This had rotation problems, performance problems, and then rendering problems. And this was an eye candy feature – mainly the version/web page information plus additional information for learning morse.

The rotation problem was due to the method to present the morse code table, it was 3 columns that went off the screen in landscape, so this had to be changed – leading a performance problem. This issue came from my use of loaders to change the morse code table between portrait and landscape (I just wanted to try them out really). Creating both the portrait and landscape tables, making them invisible/visible depending on the screen orientation solved the performance, leaving only the rendering issue.

The rendering issue came from the use of a completely black background in the morse table in a application with a white background. When static this did not cause any problems, but when rotating the display white lines flickered at the top of the display. I presume this comes from the application background getting rendered first. After some hacking, the solution I chose was to invert the application when showing the morse table and rotating. This solved the issue, maybe not the cleanest solution, but it worked.

This simple morse code table feature also forced me to play with showing the status bar when in landscape mode. Removing the status bar gives more screen, and in the landscape mode height is a value resource.
Again, this caused me to dig some more to get a reliable way of working out when the application is in landscape mode. The first approach was to use the QML PageStackWindow inPortrait property, but when the virtual keyboard is shown this becomes undefined. This makes sense because when the keyboard is shown the application is in neither landscape or portrait modes. The solution is to use the Screen object’s orientation policy, as described in the developer.nokia.com wiki. This is pretty reliable and works whether the virtual keyboard is active or not, at it is very easy:

main.qml:

...
onOrientationChangeFinished: {
  appWindow.showStatusBar = 
    ( ( screen.currentOrientation == Screen.Portrait ) || 
      ( screen.currentOrientation == Screen.PortraitInverted ) );
}
...

The source code of the accepted application is here.
http://www.developer.nokia.com/Community/Wiki/File:Morseplayer_0_0_7.tar.gz

If you want to check out the application just search on the Nokia Store for morse.

Now all I need is some more real features……

Advertisements

Create a free website or blog at WordPress.com.
Entries and comments feeds.