Sunday, August 12, 2012

Meego playtime #1 : libconic0

Network-aware apps on N9 usually are QT based.
But what if you want to, let's say, port an existing ubuntu package to work on the N9, say, pptp?
You have two choices:
a) you rely on QT and recode the pptp package to work on QT
b) you walk on your own legs.

I think everyone agrees on option b) being the smarter one. So let's walk!

What options do we have outside of Qt? There is an option, according to nokia development lib! It is called libconic0! How to use it? Example is here.

libconic0 has a few limitations. Namely:
  1. use non-blocking sockets
  2. have the system D-Bus running
  3. g_type_init() has to be called
  4. employ no threading support in the Libconic API  
To test the app, you can use scratchbox'es meego-run tool.

For that, you will need Xephir. See this..

(Dis)Adventures in the Land of QT

So I had bought this N9. Beautiful phone. It's only mistake was to be born 4 years too late into the world.
And to work on QT.


 I am a beginner QT developer. This might sound funny, but it is not. It is dead-serious. There is this app I am coding, and I NEED desperately in order to be able to edit the bookmarks from the default browser on my N9 (since Nokia did not deserve it the time, unfortunately).


QT sucks.

Well, not really to be honest. It is great. Really. It does NOT suck, as said, because it's portable, it's flexible, it has every thing that you need, it has tools for every thing (really!), and a language for everything. In short, in the world of multiplatform, QT is a very, very strong God. Nice. But it simply sucks. In some ways. Especially the Windows way. The multiplatformness for Windows is simply not there yet, or not as advanced as the user (=you or me) would think it is.

So, as a beginner QT developer, with a QT phone, a Windows-based machine, what do you do? You code! On your amazing N9 phone! So you download, install, and start fiddling around (and get to know) well, QT. The first thing you realize is that QT has a pretty strong and high learning curve. This is normal. It's huge. Multiplatform. Holy shit. But do not despair! There are examples! Bring up the examples, compile them, and realize after a whole bunch of time (approximately 1 hour of searching around) that some of them will never work on your phone, and for these the multiplatform lable is but that: a label.


Well, anyway. The good old extreme way of programming never failed you. So you fire up a new project in QTCreator (sounds like Populous all over again), start a new project, and...wait a moment, there are like, what, 15 project types to choose from! Wow! But which one is mines? The Qtmobile? Must be! Rewind.
So you fire up a new project on the QTCreator for Qt Mobile. A very simple "Hello world". The traditional.
Nothing extra. Compiles, packages, runs. Wow! It works! You have the proof!
Now you want to expand the feature set of your app. Where to start from? Google is your friend! Examples too, but as mentioned, not all of them work. If we assume that you :

a) have installed the examples through the SDK Installer (or QTCreator's updater).
b) have found them in the QT SDK
c) have managed to get the example to run

Suppose now you make it as far as having a C++ backend, a QML frontend for your nicely growing app.
You managed to get all the functionality in it, and have it running on the phone - but wtf? You just realized special characters are not displayed..instead, question marks (??) or other uncommon ASCII characters are not displayed. Where do you look first? I can tell you, in the string handling. And you will loose alot of time in there. Why? Because the problem is not in the string management. QT handles strings beautifully.
But there is the fact that (for apps that have to support UTF-8)  QML files need to saved as UTF-8 format in order for the QML viewer to be able to display correctly UTF-8 characters. WTF? Guess what't the default text file format ON WINDOWS?? UTF-8? Response : NO. It's some weird ISO number that I do not even want to remember. Time for searching : 1 hour & 1/2 (Total so far : 2 & 1/2).
Add another three hours to your count (if you are lucky enough to find this small note).

Want to have the confirmation of the crappy Windows support for QT?
Once this last hurdle is passed, you might actually find yourself wanting to test the app.
So you have two ways. Simulator for N9, or real device. My suggestion is : use the simulator whenever possible, debugging on real device is fucking slow. iPhone in this sense has alot better development setup.
But hah! Assume you developed a C++ QML plugin. You need to deploy it correctly. For that, you need to find the correct folder for it (which btw is /Simulator/Qt/mingw/imports). And then enter the battle of QMake, because the deployment option for the simulator is missing from QT Creator.

So, you see. All in all, Qt has alot of potential. Alot of features. And everything you need to code once and deploy everywhere. Really. The tools support for Windows, tho, can pose some challenges (especially QMake deployment).

Monday, May 21, 2012

A blast from the past - on N9!

Ah, the good old times of High school, and TP7.1...
TP stands for Turbo Pascal, in case you do not know it.
And this
is how it looked. Well, how it looks _now_ via a ssh terminal, on my N9 :).


Thursday, December 29, 2011

esxi 5.0 - love it or hate it

I love it. Come on, you have to.
It's free (for two cpu's up to 6 cores each and 96 GB of RAM)!
It's easier than Esxi 4.0 (service management included)!
AND it is missing rsync - just like the previous versions. Well, that is the only downside.

Esxi 5.0 changed a bit the way of customizing the barebone hypervisor. No more oem.tgz (which was a pain anyway), welcome .vib's (which hurts even more).

SSH enabling for an example, is now easily done through the ESXi vSphere client (from the Security profile panel). The key management changed a bit tho.
The /.ssh directory is no more; instead, ssh can easily be configured from the

/etc/ssh

location. More specifically, certificates stored in the

/etc/ssh/keys-root/authorized_keys

file allows for "freedom of connectivity" for certified hosts. Easy!

If on one side vSphere client has alot of new features for easing your virtual manager life (service enabling / disabling), some things still are missing - like the rsync for example.

Monday, December 26, 2011

svn client for n9

svn is available from the Apache subversion repository.

svn depends on the libapr, libaprutils, libexpat and libdb packages; the first two can be found from the Fremantle 1.3 repo extras-devel. Grab them through wget and install them with dpkg -i (in that order).

The libdb has to be taken from the latest harmattan beta repo (provided you have installed the repository package as mentioned in here); sqlite is also needed but a simple

apt-get install sqlite3-dev

is good enough.

Libexpat can be installed as dev package from apt:

apt-get install libexpat1-dev

Afterwards, you can configure svn (with reference to apr / apr-util corrected):

configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr

and make should work just like a charm :).
After that, make install and your svn will be installed (by default) under /usr/local/bin

Saturday, December 10, 2011

Harmattan repository dependencies package

A first problem that the (few) N9 developers face is presented by the fact that there seems to be no apparent possibility for on-device compilation.
Nokia provides a proper Scratchbox and QT as development environments.
But what can be done for the people who would like to work from Windows and still compile natively?

Well, as always, the truth lies just beneath the surface, and specifically, it lies in a special .deb package deployed on the Nokia Harmattan Beta Repository

At that location, all the different beta's are made available.
We are looking for a very specific package, namely the package harmattan-repository_0.4+0m6_all.deb, which, when installed, will update our aptitude sources with the proper beta repository.

NOTE: at this time, it has not been tested if packages from previous beta versions refer to the latest beta. Thus, I strongly suggest you to grab the mentioned package from the latest beta, always.

So, in order to access the beta repository (and finally perform on-device compilation), follow the simple steps:

1) fire up a shell on your N9, wget the following package: http://harmattan-dev.nokia.com/pool/harmattan-beta3/free/h/harmattan-repository/harmattan-repository_0.4+0m6_all.deb
2) switch to root (devel-su)
3) dpkg -i

Once this has completed, install libc6-dev, gcc, g++ with apt-get and you will be ready to develope on your device! :)

Sunday, October 23, 2011

MeeGo - Go N9!

Just got my hands on this nifty little device. I LOVE it.
Apparently the phone is selling well. Although Nokia has released no numbers on the total of Phones produced, or any numbers on how many actually have been sold yet. It is what it was meant for : a phone for geeks.

So what do you need in order to develop on a N9? On Windows, QTCreator is the best choice. Make sure you install the HARMATTAN (funny how Nokia wants users know that it is highly "experimental") extensions. That's it. This will give you a perfect RAD environment to develop apps out of the pocket in a fast and straightforward way.

On Linux, you can do the same and install QtCreator. Or, in case you feel confident enough in jiggling the penguin, you can do it the proper way and go for the Scratchbox (for those versions that actually support it):

http://harmattan-dev.nokia.com/unstable/beta2/harmattan-sdk-setup.py

This will give you a total freedom; price is infinite complexity.
Typicall steps, in this case, include:

a) Locating sources of components that your application might depend upon and will be missing from the standard Harmattan repo (located in http://harmattan-dev.nokia.com/pool btw)
b) Building the components
c) Build your code against them
d) Create a package : dpkg-buildpackage -D