Samstag, 30. Juni 2012

Impressions from the BlackBerry 10 Jam Event in Berlin

I was visiting Berlin this week for the BlackBerry 10 Jam World Tour, as a few other Maemo folks were also going, and I saw it as a good opportunity to meet up with some good old community members, and visit Berlin once again (my last visit to Berlin was in 2008 for the Maemo Summit 2008). Cosimo organized a meet-up at the c-base (same location as for the Maemo Summit 2008) the night before the Blackberry Jam. Before I get too much into details, you can have a look at all my photos from Berlin.

PreJam. The meetup on Wednesday at the c-base was great, meeting old community members and discussing.. erm "recent events". Meetups like this also provide a nice opportunity to meet the faces behind nicknames in the online community. While we were sitting outside, the Google I/O event was streamed in the c-base. The Blackberry guys also joined the party and talked with us about apps and the supported development approaches (web, native, Android, Flash/AIR).

BB10 Jam. The BlackBerry event itself was held at the Spreespeicher on Thursday. After a short breakfast, the event was kicked off with a keynote - no filming or photography was allowed for the whole duration of the event in the presentation room. A few presentations (web or native in parallel tracks) later, Lunch was served and then there were a few more presentations outlining the whole developer story and focusing on mobile development itself. Having done some mobile development on other platforms myself already, the only interesting parts were the Blackberry-specific content items: How packaging and publishing works, how to load apps onto the development device, etc.. At the end, Dev Alpha devices were given out to developers and drinks and snacks were served to finish off the event.

Developing on BB10. Andrew already described the porting procedure for pure-QML apps (e.g. from Harmattan or Symbian) to BB10. After registering with Blackberry, and requesting a debug certificate (which takes at least 2 hours to get a reply back), the registration procedure for the device can be carried out, which will set everything up, so that you can deploy apps to the device. It seems a bit weird having to get everything signed by Blackberry servers before being able to sideload apps to the device (with Android and MeeGo at least, you could just take any device, switch it into developer mode and deploy - without having to "ask" anyone for permission). The Eclipse-based SDK does help with all the steps that are required to set up the device, so it's not too difficult, but annoying fir the first time (after it has been configured, the debug certificate has to be renewed regularly, but you can just deploy the app locally without a network roundtrip). Not counting all the web-based registration process and requesting the certificate, it probably took me about 30 minutes to get everything set up to build qw The Game for the BB10 Dev Alpha - including device-specific modifications to the code. That's quite neat :)

The good parts. The Dev Alpha is a nice device, with hardware specs that are up to date. The SDK is available for Windows, Mac OS X and Linux (that's how you do it, developers should be able to use the host operating system of their choice!). The SDK uses Qt by default, but you can write against pure OpenGL ES, too if you want - and according to the developer docs, an SDL port is also available. Some folks are working on a Python port to BB10, which will allow developers to easily port PySide-based applications (gPodder?) to BB10.

Improvement suggestions. You don't have root on the device. While it's okay to have a consumer device locked down, it'd be great if there was the option to have root on the developer device, if just for looking around the QNX system. Another problem is that - as far as I know - there are no UX guidelines published. Harmattan has them. Android has them. iOS has them. Publish UX guidelines and provide good example applications (not just "widget galleries" or "cookbooks") - ideally something that will look and behave like stock applications. It would be great if instead of having the PlayBook Tablet UI on the Dev Alpha, they would have provided a barebones BB10 phone UI just so that developers get a better feeling for how everything behaves.

All in all, BlackBerry has done a great job with the BB10 Jam World Tour, and I really enjoyed my time in Berlin - it was great to meet up with Maemoistas and see what they are up to these days :) Hopefully I'll get the chance to see you guys at some future events. Keep on hacking!

Sonntag, 24. Juni 2012

qw The Game ported to Android

I decided it's time to port qw The Game to Android, as a way to see how the publisher story works on Google Play compared to Ovi Publish and also to see how mature the Qt port to Android is.

For my port, I used Necessitas alpha 3 update 4, which you can download from the project website. Necessitas already includes both the Android SDK (that's the SDK you use in general, and contains all the Java APIs, etc..) and the Android NDK (that's used if you want to do native C/C++ development), so no need to install anything else. You can start Necessitas Qt Creator using "QtCreator/bin/qtcreator" in the Necessitas installation directory, but Necessitas also creates a launcher icon if you shy away from command lines.

The assumption is now that you have an existing Qt project with a qmake project file (.pro). Just open that .pro file in Necessitas Qt Creator and let it create the Android scaffolding. You can now try to build the project and run it - either in the Android emulator, an actual Android device or your N900, N950 or N9 running Nitdroid (the N950/N9 port is actually quite nice these days, and can be installed alongside Harmattan by flashing an open mode kernel with Android patches, replacing some init files and placing the Nitdroid rootfs inside /home/nitdroid/).

When you first start a Qt-based application on Android, it will redirect you to Google Play to download Ministro, which will take care of downloading the Qt libraries and storing them in a central, shared place, so that all Qt-based apps can use the same Qt libraries (which means that you can do closed-source apps, because they are dynamically linked to the LGPL'd Qt, and it also means that apps are smaller, because Qt doesn't need to be shipped with each app). One disadvantage is that the end user experience is not seamless on first startup, because your users will have to install Ministro first and wait for the Qt libraries to download.

Anyway, now you got that far and got your application running - or not. If you are missing libraries, and your application doesn't start, open the "Projects" tab in Necessitas Qt Creator and click on the "Run" tab for the Android target. There, open "Package configurations" and click on "Libraries" and check all Qt libraries that you need. When you compiled your application, there's a button ("Read information from application") that will analyze your binary and check the right Qt libraries. You can also add "Prebundled libraries", which are dynamically-linked shared libraries that will be shipped with your application. You can also check out the "Manifest", "Application" and "Permissions" tabs and configure it to your liking.

Protip: You can build the Android package on the command line using "ant" as soon as you have used Necessitas Qt Creator to create the initial scaffolding. The "android" folder will be created inside the folder where your .pro is located, and there you will find a build.xml.

Now to some code-level customizations that I had to do for my game, qw:
  • QtMultimediaKit was not found - I had to comment out sound effects for now
  • Automatic screen rotation - My game is landscape-only, and I had to tell the Android system in the AndroidManifest.xml file
  • Qt.labs.particles was not found - Again, I simply commented it out for now; I guess these QML plugins should be easy to add to Necessitas, but I didn't bother to find out for this first try
  • Screen resolutions! - Don't assume 800x480 (in case of the N900) or 854x480 (in case of the N950 and N9); make your app scale properly to the screen resolution at hand. Test this by creating a non-fullscreen window on your Desktop in different sizes, and see if the content looks right. For a quick'n'dirty first try, use QGraphicsView::scale
As far as the publishing experience goes: You have to pay a one-time fee of $25 to be allowed to publish to the Play Store (compare this to a one-time fee of 1 Euro for Ovi Publish and a yearly fee of $99 for the iOS App Store). What I found interesting is that there's basically no QA (apart from automated checks that are very helpful and give guiding error messages) and an application uploaded is published in a matter of minutes. I also like the fact that you can add a YouTube video link to the Play Store submission, so users can get a preview of how the experience is like. I published the app for free, and the UI warned me that it's not possible to convert a free app into a paid one in the future, which doesn't matter for me, but it might be a useful hint for other publishers.

qw The game is now available on Google Play for free. It's also available in Nokia store for free. Go play!