Archive for the ‘mobile’ Category

Symbian hints

Tuesday, August 17th, 2004

Want to check if a file exits or not?

In UNIX you would use fstat but not in Symbian, there you have to use the RFs::Entry() method. Makes sense? Of course it does in a Symbian-way…

Oulu university seems to have some kind of Symbian course, and they have a page with some useful Symbian hints.

Series 60 Platform 2nd Edition Feature Pack 1: What’s New – Lead Features And APIs v1.0

Wednesday, July 14th, 2004

Series 60 Platform 2nd Edition Feature Pack 1: What’s New – Lead Features And APIs v1.0

Interesting to read through.

It will support a Presence service

Series 60 Platform 2 nd Edition, Feature Pack 1 supports the Presence service as defined in the OMA IMPS v1.1 specifications. With the Presence service, the user is able to publish own Presence (availability) information to other users and also view the Presence information published by other users.

and MP3 and AAC

Multimedia Framework in Series 60 Platform 2nd Edition, Feature Pack 1 supports two new codecs: MP3 and AAC.

among other things.

via #mobitopia

Frozen Bubble For Series 60

Thursday, July 8th, 2004

Frozen Bubble For Series 60

I don’t know how many hours I’ve wasted playing Frozen Bubble on my linux machine. I guess I’ll end up wasting as many playing it on my phone now.

via Russell Beattie

Writing Good Symbian OS Applications

Tuesday, June 22nd, 2004

Symbian: Developer: Writing Good Symbian OS Applications

I might have mentioned it before but this is a really useful guide giving lots of tips and best practises. It helped me yesterday when I had forgotten a couple of important details.

Symbian Programming – Mika Raento

Friday, May 21st, 2004

Symbian Programming – Mika Raento contains a couple of useful things for us doing Symbian coding. The Symbian Programming – Generating debug symbols for the emulator article is especially interesting and might prove to be very useful.

Nokia and Symbian versus Microsoft

Monday, March 29th, 2004

This Symbian falters in battle with Microsoft article by Wireless Watch in The Register gives an interesting overview of the recent struggle over the control of Symbian.

When the Nokia-Psion deal was announced everyone assumed that Nokia would thereafter take control over Symbian, but now it seems like Ericsson and Sony are doing what they can to counter Nokia’s move.

If it would be better for Symbian to only have one controlling actor instead of as currently a consortium is hard to say, but Microsoft is expanding fast in the mobile area so Symbian and manufacturers using Symbian have to move fast or the game will be lost.

One just has to look at the current PC market to see what Microsoft dominance is like. I would hate to see the same happen with the mobile phone market.

My opinion is that Nokia should open source Series 60. It wouldn’t even have to be truly open-source, just make the source code available for anyone to download but the license might, for example, prohibit using the code in a phone without getting a “Series 60 comformance” approval. The approval process would then be a source of income for Nokia.

One could then imagine that application developers could put their applications through some tests (which might also be subject to a fee) and if the application passes it would be “Series 60 certified.” A “Series 60 certified” application would then naturally work flawlessly on all phones approved for Series 60 comformance.

But just making the source code available is not enough, they should at the same time open up the development process and tap into the open source community power.

Imagine being able to by yourself fix that one annoying bug you find so irritating when using some function of your phone.

Imagine telling your friends that you fixed the problem they complained about last week.

That is how I think Nokia could out-maneuver Microsoft in the mobile market. But will they do it? I say no, Nokia has yet to show me that they’ve understood the spirit and power of open source. Hopefully they will before it’s too late.

Using nested active schedulers

Wednesday, January 14th, 2004

If one is facing a situation where a non-active object using system needs to interact with an active object system in the same process and thread it might be useful to consider the use of nested active schedulers. It’s ugly in a way, but if done correctly it can be a good solution.

If there is one method that is blocking in the non-active object system which should still appear to be blocking to that system but it should while “blocking” execute pending active objects. If that’s the case this can be accomplished by wrapping the “blocking” method in an active object and starting a nested active scheduler (with CActiveScheduler::Start()) in the beginning of the “blocking” method but after the async request has been initiated. The RunL() method for this active object only stops the nested scheduler (with CActiveScheduler::Stop()) which resumes execution after the CActiveScheduler::Start() done in the “blocking” method.

Note however that one needs to have one active scheduler running before doing the above for this to work. But if that’s not the case, that can be fixed by using another active object…

Horrible build system

Friday, December 12th, 2003

I was going to write this long rant about how much Symbian’s build variant system sucks ass. But why bother, it’s not like it’s going to matter. So I’ll just write a short version instead.

When building a project is quite common to have to accommodate for different things like architectures, models, supported functions. Maybe even build one possibly restricted evaluation version of the software and one full version. In the unix world autoconf as ended up being the standard tool for this. Configuring, building and installing a program is usually the following simple three steps:

    $ ./configure
    $ make
    $ sudo make install

The ./configure script checks that the system contains the necessary functions and defines different constants so that it’s possible to accommodate for minor differences between the different unix flavours in the code.

It’s often also possible to affect what’s being built by supplying options to the configure script, like ./configure --with-mysql to include mysql support. This is working quite well.

Unfortunately Symbian’s build system seems to be mostly influenced by horrible windows ideas. Because it’s completely lacking something like this, it supports something called “build variants” which is a huge joke. To use it one has to add a .hrh file to the project, let’s call it BuildConfig.hrh, in this file one can have #define:s for different configurations of the software. Before building one has to edit that file and make sure that it represents the desired configuration, by commenting out unwanted features (represented by define statements) and uncomment wanted ones.

This is, however, not enough. One then has to create a directory in the epoc32\tools directory called variant and inside that directory create a text file named variant.cfg. This variant.cfg file should contain the full path to the above created BuildConfig.hrh file. Yes you read it correctly, the full path. Talk about a really portable solution…

When this is done, the bldmake and abld commands will find the variant.cfg file and the defines in the BuildConfig.hrh file will be available during the whole build process, so they can be used even in the mmp file like this

    TARGET  foobar.app
    // ...

#if defined(SOME_DEFINE)
    SOURCE foobar1.cpp
#endif

#if defined(CRIPPLED_VERSION)
    SOURCE foobar2.cpp
#endif

So now when I distribute the code for my application each person who wants to build it has to copy the supplied variant.cfg into their Symbian SDK directory and replace the path in the file with the correct path for their system. Way to go Symbian, that’s a great solution!

Please please change so that the bldmake and abld commands also look for a variant.cfg file next to the bld.inf file and for gods sake support relative paths.

Booleans in Symbian

Tuesday, December 9th, 2003

This error wasted 30 minutes of my time yesterday:

unresolved external symbol "int __cdecl operator==(int,enum TTrue)"

I understood that it was something wrong with one of my == statements but I couldn’t for the life of me figure out what. So after a while I turned to the old trusted friend google for help and I found this Symbian Knowledge Base Entry, basically that error message is given on purpose to catch coding mistakes.

Doing the below with Symbian’s TBool class is not allowed.

    TBool loop = ETrue;
    do
        {
        // ...
        }
    while (loop == ETrue);

This is how it should be written:

    TBool loop = ETrue;
    do
        {
        // ...
        }
    while (loop);

A more complicated example from the above linked knowledge base article:

     if (myTBool != theirTBool)
        {
        doSomething();
        }

should be written as:

    if ((myTBool && !theirTBool) || (theirTBool && !myTBool))
        {
        doSomething();
        }

So now you know to be careful when using booleans in your Symbian code.

Location based actions on your phone

Friday, April 25th, 2003

miniGPS for Nokia 7650 and 3650. PsiNT has created a really cool utility for the Symbian Nokia phones. The application lets you define actions which will be executed when you (well actually the phone) reaches a specific network location. This is as good as it gets until the phones get GPS as standard.

Imagine this

In the morning when you arrive at work the phone automatically switches to the work profile. At lunch it notices that you’ve gone to the city center to eat at your favorite lunch restaurant and changes to the lunch profile, which automatically forwards all work calls to your voicemail, so you can have a peaceful lunch. The phone notices when you’re back at the office and changes back to the work profile.

When driving home from work the phone starts beeping when you’re getting close to the local food store to remind you to stop and buy the things needed for the dinner.

A couple of quotes from the web page

Currently miniGPS offers five event types: – Log in alarm, – Log out alarm, – Log in switch profile, – Log out switch profile – Log in power off, – Log out power off, – Log in change image, – Log out change image, – Log in SMS, – Log out SMS
For places like church, theater, hospital etc. you can set a power off event which will just switch your phone off as soon as you come there! No more embarrassing rings during performance

I see an incredible potential for these kind of applications. But they are also scary if the information is collected by some third party. Imagine getting a free phone paid by your job which contains an embedded tracking program, so they can see where everyone is located. They could then compare that data with the time reporting system.

“Oh, this guy here said he arrived at work 8:00 but according to the phone tracking data he really arrived 8:45. hmm..”

But this is cool stuff!