Wednesday, July 30, 2008

Porting from 2nd Edition to Third Edition - 3

We were trying to use the bluetooth API for S60 3rd edition(Initial Release) SDK. But, whenever we tried to discover devices , the app crashed giving the User -Exec 3 error . But in 2nd edition, this app were working fine. Then we discovered that we need to add LocalServices capability to make this work.

Porting from 2nd Edition to Third Edition - 2

We have finally made a .SIS build for Nokia N73 and uploaded it to the phone . Whenever we tried to run the app , it showed a bizarre error called "Menu System Error(-1)" . Now, many has got the same error while porting from 2nd edition to 3rd edition, as there were quite a few posts and individual threads about this error in NewLC and Nokia Discussion Forum. The error is grotesque because the execution did not even come to E32Main() function. So, we were not being able to debug this thing. In many of the discussions, they were telling about the resource file (.rss), registration file (_reg.rss) problems. We tried all of those fixes and still we were getting that error. Then the solution came magically when one of the team member thought out of the box and checked to see what happens if we eliminate the .gif file that we were using. And it worked like a charm. The problem is that, the AppUi class had a reference to a class which used a .gif file for busy screen animation. And the .gif file was included in the .pkg file. What (probably!!!) happens is that when the application is invoked, it tries to load the .gif file from the specified location, but for some reasons , it does not find it (That is why it gets KErrNotFound (-1) ).We have tried to install the .gif file in many other places but still not being able to fix that problem. The problem still occurs whenever we include the .gif file in the .pkg file.Lets see if we can find the solution of this problem...

Monday, July 28, 2008

Symbian 3rd Edition : Displaying Error Code on Device

In Symbian S60 3rd edition , to display error codes on emulator, we have to put a file Called "ErrRd" (without extension) in the "\Epoc32\winscw\c\resource" folder . This same file can be used to display error codes on device too. we have to just use a .sis file provided by the forum nokia . This .SIS file can be downloaded from here. The .SIS file is self signed , so we dont have to worry about signing it before installing. The "ErrRd" file is then installed in the "c:\resource\" folder of the device. After installing the .SIS file , you can see the extended panic code in the device so that you can get a feel of what's going wrong. Hope this helps.

Tuesday, July 22, 2008

Symbian 3rd Edition .SIS file signing

We are working on a Symbian Project. Till a couple of weeks ago, we were developing it on the Symbian S60 2nd Edition platform. But now, we have to port it for later OS'es like Symbian 9.1 and 9.2 . Now, apparently these platforms API's have more access to OS core than the previous OS'es like 8.0x or 8.1x. So, now we have to sign a .SIS file with the IME number of the mobile phone on which we want to install and run it. The .SIS file that is created for out project is 940 KB (!!!) and at 90% of the time we fail to upload the file. So, we had to use the self-signing process. its very good for development and debugging phase.
The whole procedure is simple
makekeys -cert -password "urPassWord" -len 512 -dname "CN=WW CO=BD" keyfile.key certfile.cer

here 512 is the length of the key that is created by which we have to sign the program. It should be at least 512 (I tried for like 10 because , at the time of creating the key the program asks for random mouse clicks and the more the len the
more there are mouse clicks :-( )
and CN = company name and CO = country code

Then a .key file and a .cer file will be created. You can later sign all your test .SIS files using these two files as long as the certificate files does not expire.
Then all you have to do is : run the following command :


signsis MyFile.sis MyFile.sis certfile.cer keyfile.key "urPassWord"

Then the .SIS file will be signed. At the time of installing, it will give some warning messages, but it will get installed and you will be relieved of the signing process.

Sunday, July 20, 2008

Porting from 2nd Edition to Third Edition - 1

We are now porting a Symbian S60 2nd edition to 3rd edition. before starting to actually port, we had several speculations as how much pain the porting process is gonna give us.However, it turned out to be quite different from what we anticipated. The first step was to successfully install the 3rd edition SDK's and carbide for VS2005 so that everything works fine. This step caused some travail. Anyways, we succeeded to install and run an application both with 3rd edition and 3rd edition fp2 sdk. The device signing is a thoroughly painful thing until we find a work around of this.

The reason behind such circumlocutions is a little bit subtle here. I thought porting will be tough because of two special API's that we have used in our project : bluetooth connectivity and http connectivity. But, it turned out that the porting process caused us pain from totally different aspect : from C++ programming construct aspect. i will try to mention the places and situation where I have encountered error when porting from 2nd Edition to third edition. Its not too much technical (I assume, of course - the symbian team has full fledged documentation of what places can get error when porting from 2nd to 3rd ), its just some sharing experience.

Friday, July 18, 2008

Symbian S60 3rd edition Installation

Here is just a cursory installation procedure of symbian s60 3rd edition sdk for VS2005.
1. Download and install ActivePerl-5.6.1.633-MSWin32-x86.msi (other versions wont work for symbian s60 3rd edition - at least I couldn't)
2. Download and install Symbian S60 3rd edition SDK from forum nokia
(S60-SDK-0548-3.0-f.3.215f.zip)
3. Download and instll S60 3rd edition fp2 sdk
S60-3.2-SDK-f.inc3.2130_S603rdEdition.zip
4. Download and install Carbide for Vs 3.0.1

You will be immediately able to use the Symbian s60 3rd edition SDk. But probably the S60 3rd edition fp2 sdk will be disabled for VS2005. To enable it go here

Then you will be able to use both SDK in vs2005.

Tuesday, July 1, 2008

Changing Font of Rich Text Editor in Symbian

In CEikRichTextEditor, sometimes we may have to change the font, its size or color etc. Normally, the CEikRichTextEditor comes with its default font Attribute. If we use the default font then it looks like this :


To change its font color or font specification we have to do as follows:

_LIT(KFontSpec, "LatinPlain12");
TFontSpec fontSpec(KFontSpec,20*6);
CGraphicsDevice* screenDevice=iEikonEnv->ScreenDevice( );
CFont* font;
screenDevice->GetNearestFontInTwips(font,fontSpec);
TCharFormat iCharFormat;
iCharFormat.iFontSpec.iTypeface = fontSpec.iTypeface;
iCharFormat.iFontSpec.iHeight = fontSpec.iHeight;

TCharFormatMask iCharFormatMask;
iCharFormatMask.SetAll();

iEditBox->ApplyCharFormatL(iCharFormat,iCharFormatMask);


Then the Rich Text Editor Looks like this:



Nothing apocalyptic in it. Just a bit of information which might be necessary.