What is Gluon? Gluon is a way of creating and playing games, and for players and makers of games to get together and talk about their shared interest. Use the powerful Gluon Creator to build the games, interact with other makers and players of games on the GamingFreedom.org network site, and play them on any of the many supported platforms with one of the Gluon Player applications. To learn more, read about The Gluon Vision.

Planet Gluon

Mobile hotspot connection on Linux

Laszlo Papp - Fri, 03/08/2013 - 12:26
Hi,

I always wanted to write a short blog post about connecting to a mobile hotspot like joikuspot on my N9 phone. The application uses ad-hoc mode, but it can be easily adapted to managed mode like on the Blackberry DevAlpha, Z10 and Q10 devices. Just replace the "ad-hoc" mode with "managed". Unfortunately, joikuspot does not support wpa and wpa2, so this command will be primarily useful for wep. If you leave the key option out, it is also useful for open (i.e. brief sanity checks, et cetera).

Here you can find a reference command which works fine across distributions and even without GUI:

iwconfig wlan0 mode ad-hoc essid Test key s:TestTestTests && dhclient wlan0

It is admittedly not a big thing. However, I lost this command several times in the past. Now, I would know what to do by heart, but what about this in half a year or later? :)

Also, netcfg and similar distribution specific utils kept being broken for some reason. This was always the fallback for me which worked off-hand. Hope it helps. :-)


Categories: Planet Gluon

QtSerialPort in Qt 5.1

Laszlo Papp - Thu, 02/14/2013 - 11:24
Hi everyone,

I would like to introduce you to a project I have been working on lately under the Qt Project umbrella. Hope, you find it useful. :)

History

 

The serial port technology is quite old, but still in active use today. It is mostly used for communicating with modems, sending control commands and so forth where the universal serial bus is not necessary. I am sure many of you recall the time when soldering the pins and cable manually to get it right for the embedded boards. :-)

About a year ago, I was looking for a library for my project to handle the serial port communication with the modems I needed. As I had been about to make a touch friendly UI with QML, I thought it would have been nice to have a Qt solution. It would have been phantastic to communicate with the modem on my Windows, or Linux host.

There has been an old library around for a while, called QExtSerialPort. Unfortunately, its API looked weird and the project had been abandoned for a while without people contributing to it. Then, a chinese person began to fix certain issues, but still: the design had been carried for long from the old ages.


Serial Port Cable

Qt Project Playground


The Qt Project established a nice opportunity for contributors to start a new project, or move an existing to the Playground area. There was a discussion on the development mailing list to figure out the rules for handling this. Around the time, when I requested the QtAudio3D project into the Playground area of the Qt Project, there was a russian person, Denis, who initiated a community project into Playground in his own pastime to make a great developer experience for serial port based projects across platforms.

The library was supporting only Qt5 back then, and my project was based on Qt4. This is understandable as Qt5 was not realeased for the time, so we were unable to take the risks of the moving target. I decided to give the project a go and make support for Qt4. Not much later (i.e. 1-2 weeks), I got the first changes into the Qt Project, following the Gerrit workflow. By that time, it was more or less possible to use QtSerialPort with Qt4.


Gerrit - Code Review Tool
Our work has been achieved by using the Qt instance of the awesome Gerrit codereview tool. Almost every commit got at least one review, but many times two, or sometimes even more. I think that is nice, and helped to guarantee the quality of the work even without having a Continous Integration (CI) in place for the time.


As time time had flied, I had more and more feature requests and own changes for those to implement. That is how the library kept rolling, getting new features and bugfixes. The API was also a bit too low-level, and I began to send patchs to refactor the API to be more Qt style'ish. As I am a geek, I instantly wrote a command line based example to enumerate the devices. It was necessary for me to get the project tested on my pandaboard where the UI was not available. There were also important features added like support for gadget serial driver on Linux and so forth.



The command line enumerator example
The initial plan was to make QtSerialPort available as an add-on module for Qt 5.0. This had been proposed on the development mailing list last year. You can read the platforms and environment supported in that threa. Unfortunately, the Qt Project did not have enough capacity for this integration. Likely, it was also good for us because we were able to clean up the remaining uncertain bits of the API. I am not claiming it is now perfect, but it looks much better than it used to be. :-)

Future plans

 

As you can read in the topic of this post, QtSerialPort makes it for Qt 5.1. This has been approved by Lars, the Qt Project Chief Maintainer, in the aforementioned thread. This is a really great and exciting news for us. It is also a very good prove for the Qt Project that the idea actually works. Community people can contribute with new modules under the same umbrella with the companies behind the Qt Project.

The main short term plan is to get the integration right in terms of Jira and Gerrit to move out of the Playground scope. As the CI integration has happened lately, the project is now also covered for build tests, so we cannot end up in situations like having regressions as before. It is not so simple to maintain such a project like this without proper CI integration because we experienced many regressions on one platform when we tried to fix issues or add new features.

FTDI USB-Serial adapter

As you may already know, it is not simple to test the serial port projects automatically. There had been an initiation for a Qt Mock project from me last April, but it did not yet manage to reach any progress. Nevertheless, we are working on making tests available as much as possible.

My personal plan is to write a KDE frontend for the library, preferrably also a terminal emulator. We already have a terminal emulator example in place to represent the developer and user experience for the project. It is not full-fledged, but it has been working nice for the basic needs. You can set the baudrate, parity and stop bits, flow control et cetera. Something like that would be nice in the KDE project, or perhaps even a plasmoid. There has been a CuteCom around for a while, but when I briefly discussed the project with Alexander Neundorf last summer at aKademy in Tallin, it did not support all the platforms we need.


Terminal example

As you may already know, the QNX platform is also getting closer to a Tier 1 stage in the Qt Project. Blackberry, formerly known as Research In Motion, and KDAB made an excellent job in that area. I have been considering to add a QNX backend support for the project at some point.

Kudos

 

First of all, many thanks to the Qt Project!

Secondly, many thanks to all the contributors to QtSerialPort!

Authors
The reviewer statistic is generated by the following command: git log | grep '^ *Reviewed-by:' | sed 's/^ *Reviewed-by: *//' | sed 's/ *<.*>//' | sort | uniq -c -i | sort -n -r


Reviewers



Categories: Planet Gluon

Geek'ish application development for Blackberry 10

Laszlo Papp - Sun, 02/10/2013 - 17:26
Hi there again,


As indicated in my previous post, I am now about to summarize my developer experience for the platform Blackberry 10. As written before, the regular way of developing applications for this platform is to use the Momentics IDE or QtCreator.

Those environment usually generate the necessary qmake build system files, bar files for you to a certain extent I guess. Admittedly, I have never used them for this purpose, so this is just a gut feeling. Anyway, this is not so important for the scope of this post.


Goal



When I had started to develop my first application, I made some research if it had ben possible to develop applications the way I like: command line and cmake. For those of you, who are not familiar with cmake, it is a nice cross-platform Makefile generator thoroughly used in many projects. One open source reference is KDE for this.

Interestingly enough, I got some messages in private after my cmake based projects that people found those files and used in a similar fashion one by one. This is nice, but some explanation is necessary for newcomers. So, let us dig into more details about this.


CMake Toolchain file



In order to make cross-platform development with cmake, usually one has to produce a correct toolchain file. I looked around on the internet, and there was some examples available for QNX. I took one of those essentially to start off with. That is also one reason why it is a bit bloated, and a much simpler would be enough for achieving what we wish to.

If you are not interested in the underlying operation, you can skip the explanation below, and you can just use my toolchain file right away.

The important changes I made were the followings:


  • Use the proper toolchain binary

Use the 'qcc' build wrapper. It is essentially a wrapper around the compiler, linker, and so forth. You can find more complete documentation about it here.

This is a very important change because I started with the "ntoarmv7-g++" which is a link to the "arm-unknown-nto-qnx8.0.0eabi-g++-4.6.3" toolchain file. I also tried the latter directly, but I encountered crash for my applications even for a very simple test case without cmake. The program crashed even before entering the main function. It took me two nights at least to track the problem down.


  • Use the proper toolchain binary flags

Once I figured out I would have to use 'qcc', there were still some problems that I encountered, albeit slightly different. I had to realize the usage of certain flags is necessary. Once I made it work with the proper flags without any build system, I had to figure out the proper way of setting that for the toolchain file. Now, we have all the information necessary so here it goes the statement:

    -> SET(CMAKE_CXX_COMPILER_ARG1 "-Vgcc_ntoarmv7le -lang-c++)
  • Instruct cmake to use the toolchain file created

     -> -DCMAKE_TOOLCHAIN_FILE=/path/to/the/toolchain/file.cmake


  • The location of the toolchain file
 This is only my personal opinion, but I found it simpler to put the toolchain file into the project because then I did not have to carry that on to other machines I worked on. It is also simpler to ask other non-cmake developers to test my application if I pass a command to them. It is not a huge file, so it probably does not take up much space in the repository either. It does not clutter the project that much either in my opinion.


So this is the entire command I use from the build folder:

    ->  cmake -DCMAKE_TOOLCHAIN_FILE="../frontends/blackberry/cmake/Toolchain-QNX-8.0.0.cmake" .. && make VERBOSE =1

Find modules for Cascades libraries


This is also a very important step to find the Cascades libraries for your application. This was not a big deal, albeit I have not had time to solve this issue nicely either. So, there are rooms for improvements. :)


I have created separate cmake find modules for each library for the time being, but perhaps it should be handled more like Qt4 with a joint find module, and one can request anything out of that. So, there would be a macro with a few parameters. It would not be then necessary to copy and paste the code. If you are not up to that contribution, you probably better go with the files I created. You can find them below.






Deploying the application to the device



I wrote a primitive python script for this after gathering all the information what flags to use. Here you can the result. This one is more or less just a hint as it cannot be used that directly. I chose python because then I can also use this on Windows and elsewhere as python is a nice cross-platform scripting language.

Essentially, there are several tools that have to be used for installing and then launching the application on the device from your host system:

  • Set up the Blackberry NDK environment

I personally made an alias for this, but here you can find the comment:

        -> source /opt/bbndk/bbndk-env.sh

  • blackberry-connect
    I have not tried to develop over Wi-Fi because I use mobile internet, so that was not an option. I also prefer the usb link as it is faster and more reliable. I made aliases for these, too. You have to supply a proper public ssh file. I think the default length is not proper, but a new one can be generated easily. Here you can find the command for setting this all up:

            -> ifconfig usb0 169.254.0.2

            -> blackberry-connect 169.254.0.1 -password devicepassword -sshPublicKey ~/.ssh/id_rsa_rim.pub

    • blackberry-nativepackager 

    Here you can find an example how to use it: 

            -> blackberry-nativepackager -package -target bar test.bar /path/to/the/bar/descriptor/xml/file.xml -devMode

    • blackberry-deploy
    Here you can find an example how to use it:

            -> blackberry-deploy -installApp -device 169.254.0.1 -launchApp -password devicepassword -package test.bar



    Debugging from command line



    A simple ssh connection can be used for logging into the device once the development mode is switched on in the settings. It has to be done after each boot as of now on my devalpha, at least. Make sure the connection is established properly and the blackberry-connect process is still up. Here you can find the command for that:

        -> ssh -i ~/.ssh/id_rsa_rim devuser@169.254.0.1

    Once this is done, there are some tricks to get information about QML syntax issues, C++ crashes, reading your intended log file, and so forth:

        -> slog2info -w 

        or/and


        -> cd /accounts/1000/appdata/${id_from_the_bar_descriptor_file}/logs && cat log

    You can also get the screenshots created on the device by pressing the two volume buttons simultaneously:


        -> scp -i ~/.ssh/id_rsa_rim devuser@169.254.0.1:/accounts/1000/shared/camera/IMG_*.png /path/to/the/directory/to/store/the/screenhots



     

    Application signing for AppWorld


    Here you can find the command I used:


        -> blackberry-nativepackager -package -target bar test.bar /path/to/the/bar/descriptor/file.xml -sign -cskpass devicepassword -buildId 1


    Note: Do not forget that you have to increase the -buildId value for each new signing.

     

     

    Testing someone else's application


    This is also a common request that someone would like to get feedback about the application before even getting approved in the AppWorld. In such cases, you may request your friends and acquaintances to test it. This could also happen vice versa so that you are asked for testing an application and provide feedback. Hence, it is useful to know how you can do that. Here is the command I used.


            -> blackberry-deploy -installApp -device 169.254.0.1 -launchApp -password devicepassword -package test.bar



    Conclusion


    Like many things in the life, this is also possible. I do not find any issues with this workflow for application development, but I am a bit strange developer. I am glad to have found the way I like spending my time. Many thanks go to Bill Hoffman from Kitware for patiently helping me with cmake issues on the cmake mailing list.


    Hope, it helps some people out there.


    Happy Blackberry 10 hacking! :-)
    Categories: Planet Gluon

    New applications for Blackberry 10

    Laszlo Papp - Sun, 02/10/2013 - 11:26
    Hi everyone,


    Introduction

    I have been planning this post for a while, but I had some real life troubles and also other duties. Finally, I have some time to write this down briefly!

    In short, I have created two new applications for Blackberry 10. I tested them on my DevAlpha device. The first one became the candidate for getting a Limited Edition device in the end.


    Wiki Reader

    As I have been a wikipedia fan for a while, I thought this would be a good idea to help myself and others to have an application for reading wikipedia pages easily. There was an application on Harmattan (N9) called "Cutewiki" available in Ovi Store. I had been using that a lot because I think it is a great application. As the author did not plan to port that to Blackberry 10, I wrote one for myself.

    The source code is available under the KDE umbrella. The application was approved in AppWorld, but here you can find some screenshots embedded as well:




    Searching for articles
    Reading articles

    Mrdanga Player

    I had been playing bass guitar for many years during my student years, and I have been a fan of mrdanga recently. There was an application for Harmattan (N9) called "Finger Drums". I felt in love with that application after the first checkout. It is an awesome piece of software with lots of fun!

    This drove me to write an application for Blackberry 10 to enable people to get to know what mrdanga is and how it sounds. It is a lot simpler emulation than a whole drum kit. I think it is still nice for those who like this instrument, and potential newcomers that can get to know it this way. There is also a nice video on youtube if you would like to check out what the masters can do with this instrument. :)

    The source code is available under the KDE umbrella. The migration is now ongoing to Playground/Mobile where the wiki-reader also resides.

    The application was submitted to AppWorld, and it is in review stage. For those who would like to try out the latest version, I uploaded the package to my dropbox. I would also like to share some screenshots here.

    Splash screen

    Mrdanga heads with darker background
    Mrdanga heads with brighter background


    Kudos

    Many thanks go to RIM for providing DevAlpha and Limited Edition devices to the community!

    For sure, many thanks go to the KDE Project as well for providing the source code repository, bugtracker, and the whole KDE infrastructure for this!

    There will be a follow up post soon about developing Blackberry 10 applications from command line with cmake. Stay tuned!




    Categories: Planet Gluon

    Join us at the Qt Contributors' Day

    Dan Leinir Turthra Jensen - Wed, 10/05/2011 - 18:57
    Back in June, an event was held in Berlin called the Qt Contributors' Summit. This was such a success that the team decided that it should not be the last time something like that happened. So, to further this success, Nokia's Qt Frameworks Division has offered KDE a whole day of unconferencing at the Qt Developer Days in Munich later this month.

    If you wish to take part in furthering the collaboration between KDE and Qt, and indeed other projects, then join the Qt Contributors' Day on Monday the 24th of October at the Dolce Munich Unterschleissheim. To join in, send me an email at admin@leinir.dk to that effect :-)

    You don't have a ticket to Developer Days, you say? Well, not to fret! The KDE e.V. has been given a bunch of tickets to be given out to community members. To get your hands on one of these tickets, give me an email at admin@leinir.dk to inform me of this.

    Please note! If you decide that you want to join us, get in touch with me BEFORE the end of this week! (i.e. before Sunday the 9th, which is when i send off the list of people requesting tickets and the like to the e.V. board for evaluation).

    So - come to the Qt Contributors' Day at Developer Days 2011 in Munich, and let's make this thing epic! Qt 5 is ahead, and with the launch of the Qt Project, we have more to say than we ever did before! :-)


    Qt Contributors' Day happens here! ;-)

    Categories: Planet Gluon

    GDC Europe and the Desktop Summit

    Dan Leinir Turthra Jensen - Wed, 09/07/2011 - 01:07
    Lately, the Gluon team has been pulling a whole lot of work together, which is why you've not been hearing about us all that much unless you've sat in the channel with us. As you most likely know, the Google Summer of Code and Season of KDE tutoring programs ran over the summer, and Gluon of course took part in both. That is not what this blog entry is about, at least not directly - i simply mention it because as we are now at an end, we are getting closer to our next release, which will happen once the three projects are merged into master.

    What this blog entry is about is what we've been up to over the last few weeks - specifically attending the enormously successful Desktop Summit in Berlin, and immediately following this GDC Europe.

    Desktop Summit

    While at the Desktop Summit, the Gluon team took part in various events, some of which got filmed. Unfortunately, as it turns out, the recording equipment seems to have more or less exploded, and while they're working on it and hope to still be able to gain at least some of the presentations, i thought it best to publish this none the less.

    The first event we took part in was the lightning talks, where Felix Rohrbach spoke about his Season of KDE work implementing support for the Achievements module in the Open Collaboration Services draft.

    Felix Rohrbach on Achievements in Gluon from Dan Leinir Turthra Jensen on Vimeo.



    The next event, unfortunately without video here, was our presentation. This had both Arjen and myself on stage, where we first talked about how this was our second aniversary in our current form, with the Gran Canaria Desktop Summit being the initial event which allowed us to eventually formulate our vision. After this, we showed off Gluon Creator, and what we can do with it. Finally, Shantanu showed up to show off his work on the distribution system - the part which allows you to push games directly from inside Gluon Creator and download them using any of the Gluon Player applications. From a personal viewpoint, let me just say - while the presentation fell apart due to broken network, it is still very impressive stuff!

    Similarly without video, but very productive, we had our BoF, which unlike last year, where we spent the time brainstorming about the future direction of Gluon, we spent helping those present getting to grips with how to build games using Gluon. This event further showed that we need to get those screencasts done, showing how to use Gluon Creator to build games. If you want to help us with this endeavour, drop by the channel and we'll talk ;-) Scripts for the first few of them are already done, and they primarily need to be recorded.

    Finally, of course, hacking went on. One of the things which we spent time on (Arjen specifically) was the particle system. So, when he had something to show off, we recorded this little video, where you unfortunately cannot see just how fast the whole thin is - but this is drawn eight times on top of itself, and there is no perceivable slowdown. Impressive stuff :-) And this, i'm told, is entirely unoptimized as it stands, so expect impressiveness when it's merged into master later ;-)

    The First Gluon Particles from Dan Leinir Turthra Jensen on Vimeo.



    GDC Europe

    At the Qt Contributor's Summit in Berlin, Sulamita Garcia from the Intel AppUp team came up to me and asked two questions: Were i available in mid August, and would i like to go on stage to talk about Gluon. I'm always happy to talk about Gluon to anybody who'd like to listen, and it just so happened i was available at that time. So, as it turns out, they would like to bring Gluon to GDC Europe for an AppUp event. Over the next few weeks (six weeks from the invitation was extended until GDC Europe was due to happen) we worked on putting together something to show off there.

    As it turned out the AppUp Lab got cancelled, but this happened at such a late time that everything else was already ordered, so Arjen and i went merrily on our way to Cologne, checked into the hotel and eventually got our passes. We walked around on the floor, talking to as many people we could about Gluon and what we are trying to do for the Makers and Players of Games, and a lot of people were more than happy to hear what we had to say.

    There was lots of interest in using our various libraries directly, and our distribution system hit home as well with many people. We also spoke with a supplier of payment solutions about what we might be able to do for our donation-based monetization concept, and got some very good insights on this.

    Finally, of course, everybody likes a bit of swag, and Intel decided to sponsor us some really nifty t-shirts! With a graphic designed by Eigene "it-s" Trounev, Arjen, Bjoern, Monika and i looked dashing in our dark blue Gaming Freedom t-shirts. Here is Arjen looking confused on the final day of the event (sorry, didn't get to taking other shots, we were so much all over the place i totally missed taking pictures ;-) ):

    arjen-gluon-shirt

    Now, as the AppUp Lab event got cancelled, i now have the remaining t-shirts in two boxes here in my home. So, we came up with the idea that, other than making sure that the Gluon team gets some t-shirts to wear, we would give others the opportunity to get one as well. And as these ones are a bit special, we thought that it would make sense to make it a bit of a competition rather than simply handing them out: So, make a game with Gluon Creator and get it up on GamingFreedom.org (through http://test.gamingfreedom.org/ - or using Shaan7's GSoC work to do it directly from Gluon Creator), and get in touch with us about it, so make sure you're you, so you can get your t-shirt! Note, there are about 200 t-shirts in various sizes, so to make sure you get one, you will need to get there before everybody else - this is first come first serve after all... and who knows, there might be an achievement in this later on ;-)

    Next?

    The next steps on the path towards gaming freedom are many. Some of them are:


    • Merge the tutored projects in

    • Release a snapshot

    • Produce those screencasts to help people build games

    • Use those t-shirts constructively - want one? Make a game! :-D


    Categories: Planet Gluon

    Achievements for Gluon

    Felix Rohrbach - Wed, 06/29/2011 - 16:50

    Hi Planet KDE!

    Yeah, I know I’m late, but here’s another Season of KDE student :) My name is Felix Rohrbach and I am working on a statistics and achievements system for Gluon.

    What are Statistics and Achievements?

    The simplest form of a statistic is a score, which is created during a game, and at the end of the game, it will be compared with the highest score you ever got in this game, and saved, if it is higher. More complex ones are arrays, where every index is connected to a certain event, like visiting some place in a RPG or getting a coin in a platform game. Another option would be to have more than one score saved, or to get an average score of all the times you played.

    An achievement is on top of a statistic. An achievement defines that you need at least an score of X in a certain statistic to get this achievement, or you need to get X indexes in the array, etc. Additionally an achievement can have other achievements as dependencies. If you don’t have achieved all the dependencies, you won’t see the achievement.

    What I have already done

    Simple score statistics and achievements are already done. To use them, you need to create a Statistic Asset and a Achievement Asset in the project dock. Now, you can right-click on them to create a new statistic and achievement. Then, you connect the achievement with the statistic (just click on the button next to the label "statistic"). To change the statistic, you need to add a Statistics Component to an object in the Scene dock. Again, you need to connect that component to the statistic. Then it should look like this:

    Now, you open your script component of that object (or add a new one) and type things like

    this.GameObject.StatisticsComponent.statistic.score = 20;

    to change the current score. To save the score at the end, you need to call

    this.GameObject.StatisticsComponent.statistic.commitScore();

    Now, Gluon will save scores for every user that plays your game. To see your achievements, you need to copy your game to /usr/share/gluon/games/ and to open the KDE Ext Player of Gluon. Select your game in the list of the installed games, go to the achievement tab and you should see something like this:

    Plans for the future

    First, I will work on more complex statistics (like the array one) and achievements (dependencies). Then the visual presentation of achievements needs to be improved (icon, progress bar). Other Gluon player applications might also get achievement support.

    The most exciting feature is in a more distant future though: support of Open Collaboration Services server (show and sync achievements) :) But here, libattica and the server have to support this first, so I still need to wait some time before working on that.

    Want to test?

    You can find the code in the Gluon repository (git clone git://anongit.kde.org/gluon) in the branch "achievements". I would be happy about some constructive feedback or feature wishes, just leave a comment here or tell me on the #gluon irc channel about it (my nick is fxrh). Ah, and before I forget:

    so you can speak with me there, too :)


    Categories: Planet Gluon

    Gluon GSoC update

    Shantanu Tushar - Thu, 06/16/2011 - 21:49

    (Quite some time since I last blogged, have been busy with life's "last exams" and a project work demonstration in which the examiner says I need to relax and enjoy more. Yeah, right cheeky)

    I will be spending this summer working on Gluon as a part of Google Summer of Code 2011. The work will be mainly to add features that Gluon needs for the next release.

    As the post title says, here is the stuff completed till now-

    • One problem with Gluon Player's library code was it didn't do the abstraction between Gluon Player's logic and Attica (KDE's OCS client library), thereby putting a lot of duplicate code at places. This has now been fixed by providing a proper abstraction layer between Gluon Player and Attica. This also gives the additional benefit of being able to use other protocols, if needed in the future.
    • Second, Gluon is now able to download and install games from the gamingfreedom.org server. This is not implemented in GUI, so usual testers will have to wait for some more time, as we are still working on using a standard archive library for our work, and resolve some non-technical issues.
    • Finally, the library has support to rate games. Again, the GUI for this is not yet ready.

    Because GUI for some functionality is missing, there are no screenshots sad. But no need to worry,  it is one of the tasks I will be taking up next. Thanks for reading smiley

    Categories: Planet Gluon
    Syndicate content