<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Symbian Programming</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/" />
    <link rel="self" type="application/atom+xml" href="http://symbian.compactbyte.com/atom.xml" />
    <id>tag:symbian.compactbyte.com,2009-07-01://1</id>
    <updated>2009-07-01T11:13:14Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.261</generator>

<entry>
    <title>AppTRK Jailbreak and what it means for Symbian Developers</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2008/05/apptrk-jailbreak-and-what-it-means-for-symbian-developers.html" />
    <id>tag:symbian.compactbyte.com,2008://1.26</id>

    <published>2008-05-11T04:03:12Z</published>
    <updated>2009-07-01T11:13:14Z</updated>

    <summary>Symbian security is very useful for users. Currently there is no virus that I know of that can run on the new Symbian 9.0 because of the new security framework. From the developer point of view, this security framework is...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>Symbian security is very useful for users. Currently there is no virus that I know of that can run on the new Symbian 9.0 because of the new security framework. From the developer point of view, this security framework is sometimes frustrating. The developer needs to sign his application, and then he have to specify what capabilities are needed for the application. We can categorize the Symbian security capabilities to 4 sets. The first one is the default one, which doesn't need any user intervention, the second is <strong>User Grantable</strong> capabilities which can be granted by the user (the installer will ask the user that the program needs some capabilities), the third one is the one that the developer must ask from Symbian, and the last one is the one that the developer must ask from the device manufacturer.</p>  <p>&#160;</p>  <p>The problem starts to appear when you need additional capabilities other than the default and User Grantable. For example we will need NetworkControl capability to create a ping application. Here is how you would do it according to the old process: </p>  <ol>   <li>You will need to get a certificate from Symbian, then you can test it only on one device. </li>    <li>To be able to distribute it, you must submit your application to be tested by Symbian (this process is not free). The last process will take several weeks.</li> </ol>  <p>The old process have some loophole that is being used by crackers. For applications for which they can not generate the serial number, they patch the application, and the user that wish to use the cracked application will need to get a certificate from Symbian, and sign the cracked application so that it will work on his phone. Now they revised the process:</p>]]>
        <![CDATA[<p><br />
  <ol>   <li>You will need to compile your application, and upload to Symbian for signing. You can only sign an application that is yours (the UID of the application must match to one of the UID that you have requested from Symbian). This will prevent a user from signing 3rd party application (which presumably a cracked application).</li>    <li>To distribute your application, you will still need to pay. As an improvement, they have provided express signing, where you can quickly sign your application without testing it. They will pickup some application for random testing.</li> </ol>  <p>As you can see, the development process becomes more difficult because now we must sign our application online. People keep telling others that only a small set of capabilities are restricted, but that is not entirely true, it depends on what kind of application you are developing. For example, this kind of simple applications needs more than User Grantable capabilities: VoIP applications, screen capture that can be activated by shortcut, network ping tool. </p>  <p>Recently, a flaw has been found in the debugging mechanism used by Symbian (AppTRK). The debug server on the Symbian side is an all-powerful application that has all the capabilities in the world, and can be controlled to do <em>anything</em> from the PC side when debugging. As you can guess, this can bypass all the security measures in Symbian. I tried the method, and it works very nicely. This process makes it very easy for me to test any kind of functions, including those that requires special capabilities. </p>  <p>I am quite sure that this hole will be plugged in the next firmware release, and it will be a shame, because this bug can actually helps developer, without risking simple end user. This hack is not so simple, so I think anyone that can do this hack is not a simple user, and can be responsible for the harm that it might done his phone. I really hope that Symbian will provide a nice, legal, documented ways for a developer to really &quot;own&quot; his phone to be able to develop anything, and still uses the current security method for end users.</p></p>]]>
    </content>
</entry>

<entry>
    <title>Missing Separator Error</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2008/05/missing-separator-error.html" />
    <id>tag:symbian.compactbyte.com,2008://1.25</id>

    <published>2008-05-09T15:49:45Z</published>
    <updated>2009-07-01T11:13:14Z</updated>

    <summary>Quite many people found the message &quot;Missing Separator Error&quot; when building GCCE target. Usually this happens because the path to GNU CSL ARM compiler is not correct. The line that causes the problem is usually generated by cl_bpabi.pm, in sub...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="For developers" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>Quite many people found the message "Missing Separator Error" when building GCCE target. Usually this happens because the path to GNU CSL ARM compiler is not correct. The line that causes the problem is usually  generated by <code>cl_bpabi.pm</code>, in sub <code>GCCLibPath</code>. The subroutine  will try to execute this:</p>

<p><code>arm-none-symbianelf-g++ -print-libgcc-file-name</code></p>

<p>to find the path to GCC include files.</p>

<p>So in case anyone else is having the same "missing separator. Stop",<br />
just check if you can run:</p>

<p><code>arm-none-symbianelf-g++</code></p>

<p>If you can not run it, then somehow "arm-none-symbianelf-g++.exe" is not<br />
on the path or the path that you set in the system is wrong/mistyped.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Carbide C++: 8 Months Later</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2008/04/carbide-c-8-months-later.html" />
    <id>tag:symbian.compactbyte.com,2008://1.24</id>

    <published>2008-04-11T14:37:34Z</published>
    <updated>2009-07-01T11:13:13Z</updated>

    <summary>After using Carbide C++ for about 8 months, I think Carbide is not so bad. For my main open source project (Symbian bible), I still prefer Linux with my custom Makefile. The good thing about Carbide is that you can...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>After using Carbide C++ for about 8 months, I think Carbide is not so bad. For my main open source project (<a h ref="http://www.compactbyte.com/symbianbible/">Symbian bible</a>), I still prefer Linux with my custom Makefile. The good thing about Carbide is that you can easily debug your project in the emulator. This is still impossible to do in Linux. For the commercial version (Professional onward)  you can even debug on the device.</p>

<p>For the commercial version, the GUI designer is quite OK for many kinds of applications. You can create dialogs in minutes which usually takes hours. The GUI designer will not be too useful if you are building games, or applications that only have one view ("one screen"). The GUI designer is extremely useful for developing application with many data forms. As for the advanced features like performance tools or tools for the OEM, I have never tried it.</p>

<p>So is Carbide C++ for you? This tool is useful at least for one thing: debugging using emulator. If you need to do on device debugging or designing many applications with many data forms, the it might be useful for you to upgrade to the non free version. For me, I think I will do most of my project using the command line. If I can do debugging or use the emulator in Linux, then I would probably use Linux.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Initial Experience Using Carbide C++</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2007/08/initial-experience-using-carbide-c.html" />
    <id>tag:symbian.compactbyte.com,2007://1.23</id>

    <published>2007-08-31T03:00:36Z</published>
    <updated>2009-07-01T11:13:13Z</updated>

    <summary>I was seriously considering buying a professional license to Carbide C++, but now I am not sure anymore. C++BuilderX 1.5 Mobile Edition was a great product by Borland, or at least is was going to be great, but the decided...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>I was seriously considering buying a professional license to Carbide C++, but now I am not sure anymore. C++BuilderX 1.5 Mobile Edition was a great product by Borland, or at least is was going to be great, but the decided not to continue with it. With the Carbide C++ professional edition (and with C++BuilderX mobile)  I can develop simple GUI for Symbian very quickly. Building a GUI in Symbian involved editing resource files, and writing many classes.</p>

<p>I am a bit disappointed with many bugs in Carbide 1.2. The bugs are also inconsistent, so I can't get myself used to it. Sometimes the GUI editor spits out error messages, and it is not clear on how to workaround it. Most of the time, I can not find an easy way to add an event handler. The default action for a view is to exit from an application, and there is no easy way to override the action.</p>

<p>I thinkI am going to write more, once I use this thing more.</p>]]>
        
    </content>
</entry>

<entry>
    <title>LogExport</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2007/07/logexport.html" />
    <id>tag:symbian.compactbyte.com,2007://1.22</id>

    <published>2007-07-13T01:47:50Z</published>
    <updated>2009-07-01T11:13:13Z</updated>

    <summary>When I released my utility: LogExport, I didn&apos;t think that many people will use it, but I was happily surprised to know that many people use it, and give comments on my blog. LogExport is just a very simple application,...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>When I released my utility: <a href="http://tinyhack.com/freewarelist/s603rd/2007/03/02/logexport/">LogExport</a>, I didn't think that many people will use it, but I was happily surprised to know that many people use it, and give comments on my blog.  LogExport is just a very simple application, it reads your call/sms log, and export them to a CSV file. In this post, I will explain the inner working of LogExport.</p>

<p>LogExport uses Symbian API to access the call log (the classes are: CLogClient, CLogFilter, and CLogViewEvent). Because there might be many entries, I must use Active Object and progress bar to show the export progress. Nothing fancy here, but to find format of each field, I needed to do some experiments (e.g: does the field contains a comma, if so it must be escaped to display properly in CSV). I also need to find the event type for Wifi, which was not documented when I wrote the app (I don't know whether they have document it now), The value of event.EventType().iUid should be 0x1000595F for Wifi.</p>

<p>You can download the source code <a href="http://tinyhack.com/freewarelist/s603rd/wp-content/uploads/2007/07/logexport11src.zip">here</a>.</p>]]>
        
    </content>
</entry>

<entry>
    <title>RBuf and RStringBuf for Symbian 7.0</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2007/04/rbuf-and-rstringbuf-for-symbian-70.html" />
    <id>tag:symbian.compactbyte.com,2007://1.21</id>

    <published>2007-04-13T02:07:33Z</published>
    <updated>2009-07-01T11:13:13Z</updated>

    <summary>RBuf is an interesting descriptor class introduced in Symbian 8.0. Based on RBuf, Penrillian has created RStringBuf which provides functions very similar to the other descriptors - but which manages its own memory allocation for all the common string operations...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p><a href="http://developer.symbian.com/main/downloads/papers/RBuf/Introduction_to_RBuf_v1.0.pdf">RBuf</a> is an interesting descriptor class introduced in Symbian 8.0. Based on RBuf, Penrillian has created <a href="http://www.penrillian.com/index.php?option=com_content&task=view&id=66&Itemid=64">RStringBuf</a> which provides functions very similar to the other descriptors - but which manages its own memory allocation for all the common string operations (e.g. no need to extend the descriptor manually for Append or Insert).</p>

<p>I am currently rewriting the rendering engine for my <a href="http://www.compactbyte.com/symbianbible">Symbianbible</a>, and I need a class that is similar to RStringBuf. My bible reader supports multiple Symbian platform (UIQ 2, UIQ 3, Series 60, Series 60 3rd edition, Series 80, Series 90) so I can't use the RStringBuf from Penrillian since it depends on RBuf. </p>

<p>Rather than rewriting RStringBuf from scratch using existing descriptor, I decided to write my own RBuf class that is similar to Symbian's RBuf. It is not difficult, since the source codes of other descriptors implementation are available in file UC_DES16.CPP and UC_DES8.CPP on old EPOC SDK (although it is incomplete). I only implemented the RBuf16, but implementing RBuf8 would not be so different.</p>

<p>You can download my implementation here: <a href="http://symbian.compactbyte.com/RStringBuf_1_1.zip">RStringBuf_1_1.zip</a></p>]]>
        
    </content>
</entry>

<entry>
    <title>Porting of S60Dict to 3rd edition</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2007/02/porting-of-s60dict-to-3rd-edition.html" />
    <id>tag:symbian.compactbyte.com,2007://1.20</id>

    <published>2007-02-27T16:30:31Z</published>
    <updated>2009-07-01T11:13:13Z</updated>

    <summary>I have ported S60Dict to 3rd edition. There is no special steps involved in porting this program since it does not use any strange stuff. You can download the source code and binary from: http://tinyhack.com/freewarelist/s603rd/2007/02/26/s60dict-for-3rd-edition/....</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>I have ported S60Dict to 3rd edition. There is no special steps involved in porting this program since it does not use any strange stuff. You can download the source code and binary from: <a href="http://tinyhack.com/freewarelist/s603rd/2007/02/26/s60dict-for-3rd-edition/">http://tinyhack.com/freewarelist/s603rd/2007/02/26/s60dict-for-3rd-edition/</a>.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Descriptors vs C Strings (part 1)</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2007/02/descriptors-vs-c-strings-part-1.html" />
    <id>tag:symbian.compactbyte.com,2007://1.19</id>

    <published>2007-02-24T08:45:37Z</published>
    <updated>2009-07-01T11:13:12Z</updated>

    <summary>The easiest way to learn about the descriptor is trough the equivalent code in C. In this post, I will write a short comparison, this article is inspired by the explanation about Symbian Descriptor on the the Professional Symbian Programming...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>The easiest way to learn about the descriptor is trough the equivalent code in C. In this post, I will write a short comparison, this article is inspired by the explanation about Symbian Descriptor on the the <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2FProfessional-Symbian-Programming-Solutions-Platform%2Fdp%2Fproduct-description%2F186100303X&tag=yohannugro-20&linkCode=ur2&camp=1789&creative=9325">Professional Symbian Programming</a><img src="http://www.assoc-amazon.com/e/ir?t=yohannugro-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> (I said inspired, my explanation is different, and the code in the copy of the book that I have is sometimes incorrect). In this part I will talk only about constant/immutable strings.</p>

<p>In C, if you define something like this:</p>

<p><code>static const char hellorom[] = "hello";</code></p>

<p>Then the string "hello" will be on a non-modifyable memory space (may be in ROM or RAM, but it can not be modified).</p>

<p>The equivalent code in Symbian is:</p>

<p><code>_LIT(KHelloROM, "hello");</code></p>

<p>Everything is still easy to understand here: you can not modify the contents of <code>KHelloROM</code> or <code>hellorom</code>. Something to note is that in Symbian the string is not NULL terminated, the length of the string is recorded in KHelloROM.</p>

<p>Now, in C, you can also have a <b>pointer</b> to the same location:</p>

<p><code>const char *helloptr = hellorom;</code></p>

<p>We can have that in Symbian:</p>

<p><code>TPtrC helloPtr(KHelloROM);</code></p>

<p>helloPtr contains a pointer to KHelloROM, and the length of the descriptor pointed by that pointer. You may think it is a bit strange: why do we need to store the length again?. The reason is that we can have a pointer to the first n part of the string, like this:</p>

<p><code>TPtrC ptr2(KHelloROM().Ptr(), 2);</code></p>

<p>If you try to display/print ptr2, it will say the string "he".</p>]]>
        <![CDATA[<p></p>

<p>We can also put the "constant" data in stack (it will not become constant anymore, since stack is always writeable):</p>

<p><br />
<code><br />
//this code is inside function <br />
char hellostack[sizeof(hellorom)]; //sizeof counts the NULL terminator<br />
strcpy(hellostack, hellorom);<br />
</code></p>

<p>This is a bit different in Symbian:</p>

<p><code>TBufC&lt;5> helloStack(KHelloROM);</code></p>

<p>The string "hello" will live on the stack, along with the pointer and the length, but you can not modify the data through the variable helloStack. This is a bit useless, but using the TPtr class, you can still change the data (which is strange). I will discuss about this on part 2.</p>

<p>And you can put the string in the heap:</p>

<p><br />
<code>const char * s = strdup(hellorom);</code></p>

<p>In Symbian:</p>

<p><code>HBufC *h = KHelloROM().AllocL();</code></p>

<p>The <code>HBufC</code> class points to a data in the heap (that is owned by the object), and has a maximum length. Just like TBufC, this isn't really constant String (modifiable trough TPtr).</p>]]>
    </content>
</entry>

<entry>
    <title>Porting to Series 60 3rd Edition: Handle the End Key</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2006/11/porting-to-series-60-3rd-edition-handle-the-end-key.html" />
    <id>tag:symbian.compactbyte.com,2006://1.18</id>

    <published>2006-11-23T05:37:55Z</published>
    <updated>2009-07-01T11:13:12Z</updated>

    <summary>On Series 60 3rd edition, pressing the END key will kill your application instead of bringing it to the background. In some applications, this behaviour is unwanted (e.g: Instant Messaging application), and the old behaviour is preferred. To handle the...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>On Series 60 3rd edition, pressing the END key will kill your application instead of bringing it to the background. In some applications, this behaviour is unwanted (e.g: Instant Messaging application), and the old behaviour is preferred.</p>

<p>To handle the END key, you can create a method <code>HandleWsEvent</code>, and intercept the KAknUidValueEndKeyCloseEvent, you can save the state of the of the app then exit, or saving the application state then go to background, or just go to background.<br />
<code><font color="#000000"><br />
#ifdef __SERIES60_30__<br /><br />
void CS60BibleAppUi::HandleWsEventL (const TWsEvent &aEvent, CCoeControl *aDestination)<br />{<br />  <br />
switch (aEvent.Type()) {<br />        case KAknUidValueEndKeyCloseEvent:<br />        {<br />            /*do something, like saving the state. <br />If you want your program to exit, call  CAknAppUi::HandleWsEventL(aEvent, aDestination);*/<br />            break; /*or just go to background*/<br />        }<br />        default:<br />        {<br />            CAknAppUi::HandleWsEventL(aEvent, aDestination);<br />        }<br />    }<br />}<br />#endif</font><br />
</code></p>]]>
        
    </content>
</entry>

<entry>
    <title>Porting to Series 60 3rd Edition: Make it resizeable</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2006/11/porting-to-series-60-3rd-edition-make-it-resizeable.html" />
    <id>tag:symbian.compactbyte.com,2006://1.17</id>

    <published>2006-11-23T05:24:49Z</published>
    <updated>2009-07-01T11:13:12Z</updated>

    <summary>S60 3rd edition phones comes with different screen size (unlike thre previous editions that has fixed size screen or has a compatibility screen mode), so you must make your code resizeable, and some series 60 phones can have their orientation...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>S60 3rd edition phones comes with different screen size (unlike thre previous editions that has fixed size screen or has a compatibility screen mode), so you must make your code resizeable, and some series 60 phones can have their orientation changed (by twisting the phone).</p>

<p>In your AppUI class, add <code>HandleResourceChangeL</code> method:<br />
<code><br />
void CS60BibleAppUi::HandleResourceChangeL(TInt aType)<br />
{<br />
&#xA0;&#xA0;&#xA0;&#xA0;        CAknAppUi::HandleResourceChangeL( aType );<br />
&#xA0;&#xA0;&#xA0;&#xA0;    if  ( aType == KEikDynamicLayoutVariantSwitch )<br />
&#xA0;&#xA0;&#xA0;&#xA0;    {<br />
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; /*call sizechanged on all views*/<br />
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;   iSettingView-&gt;SizeChanged();<br />
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;   iKeyBindingView-&gt;SizeChanged();<br />
&#xA0;&#xA0;&#xA0;&#xA0; }<br />
}<br />
</code></p>]]>
        <![CDATA[<p><br />
If the view displays a list, the SizeChanged method should adjust the list size:</p>

<p><code><br />
void CKeyBindingView::SizeChanged()<br />
{<br />
        if (iSettingList) {<br />
                iSettingList->SetRect(ClientRect());<br />
        }<br />
}<br />
</code></p>

<p>The Container also needs to know about the resource change (changes in screen size/orientation):<br />
<code><br />
#ifdef __SERIES60_30__<br />
void CS60BibleMainContainer::HandleResourceChange(TInt aType)<br />
{<br />
	CCoeControl::HandleResourceChange(aType);<br />
    if  ( aType == KEikDynamicLayoutVariantSwitch ) {<br />
    	TRect rect;<br />
     /*if your apps support full screen, then use EApplicationWindow else just use EMainPane*/<br />
    	if (iFullScreen) {<br />
    		AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow , rect);<br />
    	} else {<br />
    		AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);<br />
    	}<br />
/*In app case, the model needs to be updated*/<br />
		iDocument->Model()->SetArea(rect);<br />
		iDocument->Model()->ClearVerseList();<br />
		iDocument->Model()->FillVerse();		<br />
/*Set rectangle*/<br />
		SetRect(rect);	<br />
    }<br />
}<br />
#endif<br />
</code></p>

<p>Done, your app should now be able to resize properly. If you use your own drawing routine, then you must adjust your code (dont use absolute coordinates). You can also use new S60v3 features, such as SVG, but it will make your code nor portable to the previous Symbian version.</p>]]>
    </content>
</entry>

<entry>
    <title>Porting to Series 60 3rd Edition: Part 3, build and install</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2006/11/porting-to-series-60-3rd-edition-part-3-build-and-install.html" />
    <id>tag:symbian.compactbyte.com,2006://1.16</id>

    <published>2006-11-23T05:06:31Z</published>
    <updated>2009-07-01T11:13:12Z</updated>

    <summary>Building the target for the phone is easy like the previous versions: abld build gcce urel But building for the Windows target is not so easy, you can use Carbide, or set your environment correctly. To use carbide, you can...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>Building the target for the phone is easy like the previous versions:</p>

<p><code>abld build gcce urel</code></p>

<p>But building for the Windows target is not so easy, you can use Carbide, or set your environment correctly. To use carbide, you can import your bld.inf, and just click on build. To use command line build, you can follow the instruction at <a href="http://www.sciabarra.com/blog/tool/2006/11/10/ABLD_with_Carbide.html">http://www.sciabarra.com/blog/</a> or check out <a href-"http://trac.webkit.org/projects/webkit/wiki">Webkit</a>, and run build -e &gt; env.bat (but adjust the EPOCROOT to the correct value, which is usually "C:\Symbian\9.1\S60_3rd_MR_X", where X is the revision number).</p>

<p>You need to modify the package file, you can see the sample files included on the SDK, here is a list that you must change:<br />
<ol><br />
<li>Change target uid for 3rd edition: 0x101F7961</li><br />
<li>EXE and DLL should go to <code>\sys\bin</code> (flat, all exe and dll goes here), not <code>\system\apps\appname</code> anymore</li><br />
<li>Place resource files in <code>\resource\apps\</code></li><br />
<li>Registration files should go to: <code>\private\10003a3f\import\apps\</code></li><br />
</ol></p>

<p>Creating the package file is easy, just type: <code>makesis filename.pkg</code></p>

<p>Create certificate file (see the SDK, you can copy paste the command line), and sign your application:<br />
<code><br />
signsis s60biblev3.sis s60biblev3.sis symbianbible.cer symbianbible.key password<br />
</code></p>

<p>OK, you are ready to install your application.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Porting to Series 60 3rd Edition: Part 2, edit your source code</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2006/11/porting-to-series-60-3rd-edition-part-1-edit-your-source-code.html" />
    <id>tag:symbian.compactbyte.com,2006://1.15</id>

    <published>2006-11-23T04:33:43Z</published>
    <updated>2009-07-01T11:13:12Z</updated>

    <summary>In your source code the macro __SERIES60_30__ is defined, you can use this to create a portable code. Ok, lets start changing the code (this is the essential part of the source code change, you should ). The most important...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>In your source code the macro  __SERIES60_30__  is defined, you can use this to create a portable code. Ok, lets start changing the code (this is the essential part of the source code change, you should ).</p>

<p>The most important change is in the function E32Dll, you must change it to E32Main:<br />
<code><br />
#ifdef __SERIES60_30__<br />
GLDEF_C TInt E32Main()<br />
{<br />
&#xA0;&#xA0;&#xA0;&#xA0;return EikStart::RunApplication( NewApplication );<br />
}<br />
# else<br />
GLDEF_C TInt E32Dll( TDllReason )<br />
{<br />
&#xA0;&#xA0;&#xA0;&#xA0; return KErrNone;<br />
}<br />
#endif<br />
</code></p>

<p>but you must include this header:<br />
<code><br />
#ifdef __SERIES60_30__<br />
#include &lt;eikstart .h&gt;<br />
#endif<br />
</code></p>]]>
        <![CDATA[<p></p>

<p>Since we use different UIDs, use different constants:</p>

<p><code><br />
#ifdef __SERIES60_30__<br />
const TUid KUidS60BibleApp = {0xF0201077};<br />
const TUid KUidS60BibleUi = {0xF0201079};<br />
#else<br />
const TUid KUidS60BibleApp = {0x10201077};<br />
const TUid KUidS60BibleUi = {0x10201079};<br />
#endif<br />
</code></p>

<p>If you use application path for storing data, like <code>c:\\system\\apps\\s60bible\\data.txt</code>, you must change it to <code>\\private\\\\data.txt</code>. This code will set iDataPath (defined as TFileName) on 1st, 2nd, and 3rd:</p>

<p><code><br />
HBufC *appDll = HBufC::NewLC(KMaxFileName);*appDll = iDocument->Application()->AppFullName();<br />
TParse parsa;<br />
User::LeaveIfError(parsa.SetNoWild(*appDll, NULL, NULL));</p>

<p>#ifdef __SERIES60_30__<br />
CEikonEnv::Static()->FsSession().PrivatePath(iDataPath);<br />
#else<br />
iDataPath = parsa.DriveAndPath();<br />
// If the application is in ROM (drive Z:), put settings on C:<br />
if ( (iDataPath[0] == 'Z') || (iDataPath[0] == 'z') ) {<br />
&#xA0;&#xA0;&#xA0;&#xA0; iDataPath[0] = 'C';<br />
}<br />
#endif<br />
</code><code>Enable skin support:<br />
On the </code><code>ConstructL</code> of your  class:<br />
<code><br />
#ifdef __SERIES60_30__<br />
BaseConstructL(EAknEnableSkin);<br />
#else<br />
BaseConstructL();<br />
#endif<br />
</code></p>]]>
    </content>
</entry>

<entry>
    <title>Porting to Series 60 3rd Edition: Part 1, edit build files</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2006/11/porting-to-series-60-3rd-edition-part-1-edit-build-files.html" />
    <id>tag:symbian.compactbyte.com,2006://1.14</id>

    <published>2006-11-23T04:11:59Z</published>
    <updated>2009-07-01T11:13:12Z</updated>

    <summary>I have always wanted to write this, but never had the time to do it. Porting to Series 60 3rd edition is quite easy, if you have designed your application correctly, but takes quite some time because of the details....</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>I have always wanted to write this, but never had the time to do it. Porting to Series 60 3rd edition is quite easy, if you have designed your application correctly, but takes quite some time because of the details. There are applications that will be hard to port (those that "hacks" the system) because of the new security model, but for most applications, porting to 3rd edition is quite easy.</p>

<p>First you need to create a new bld.inf and MMP file, usually you just need to change the target to <code>WINSCW GCCE</code> and add <code>gnumakefile icons.mk</code> if you are planning to use SVG icon (I think you should, and this article assumes that you are). Its rather difficult to explain the contents of icons.mk, just copy from the Series 60 Examples, and edit the svg filename. You can create the SVG icon using InkScape (free).</p>

<p>Change the MMP file as follows:<br />
<ol><br />
<li>Change target type to EXE</li><br />
<li>Name the target file from name.app to name.exe</li><br />
<li>Map your old uid from 1xxxxxxx range to Fxxxxxx range, i.e change the first hex from 1 to F (or request a new one from <a href="http://www.symbiansigned.com">www.symbiansigned.com</a>)</li><br />
<li>Change the stack size just in case it is not enough for you, add <code>epocstacksize 0x5000</code>. If your application needs large amount of heap, change also the <code>epocheapsize.</code><br />
</li><br />
<li>If your application needs special capabilites, add <code>CAPABILITY <list of capabilities></list></code></li><br />
</ol></p>]]>
        <![CDATA[<p></p>

<p>The creation of resource files from MMP needs to be changed from:</p>

<p><code><br />
RESOURCE          S60Bible.rss<br />
</code><br />
to<br />
<code><br />
START RESOURCE S60Bible.rss<br />
HEADER<br />
TARGETPATH        \resource\apps<br />
LANG SC<br />
END<br />
</code></p>

<p>Add the following code to your RSS file:<br />
<code><br />
RESOURCE LOCALISABLE_APP_INFO r_s60bible_localisable_app_info<br />
    {<br />
    short_caption = STRING_s60bible_short_caption_string;<br />
    caption_and_icon = <br />
    CAPTION_AND_ICON_INFO<br />
        {<br />
        caption = STRING_s60bible_caption_string;<br />
        number_of_icons = 1;<br />
        icon_file = "\\resource\\apps\\s60bible_aif.mif";<br />
        };<br />
    }<br />
</code></p>

<p><br />
Create registration file (it must be done so your app will shows up on the menu), names yourapp_reg.rss:<br />
<code><br />
include <appinfo .rh><br />
#include <s60bible .rsg></p>

<p>UID2 KUidAppRegistrationResourceFile<br />
UID3 0xYOURUID</p>

<p>RESOURCE APP_REGISTRATION_INFO<br />
  {<br />
  app_file="S60Bible";</p>

<p>  localisable_resource_file = "\\resource\\apps\\s60bible";<br />
  localisable_resource_id = R_S60BIBLE_LOCALISABLE_APP_INFO;</p>

<p>  embeddability=KAppNotEmbeddable;<br />
  newfile=KAppDoesNotSupportNewFile;<br />
  }</p>

<p></s60bible></appinfo></code></p>

<p>This RSS file also needs to be added to the MMP (the target is different between the emulator and the real device, why the hell are they doing that?):</p>

<p><code><br />
START RESOURCE S60Bible_reg.rss<br />
#ifdef WINSCW<br />
TARGETPATH 	  \private\10003a3f\apps<br />
#else<br />
TARGETPATH 	  \private\10003a3f\import\apps<br />
#endif<br />
END<br />
</code></p>

<p>if you are using <code>avkon.mbm</code>, change it to <code>avkon2.mbm</code>, like this:<br />
<code>#define AVKON_BMPFILE_NAME "z:\\resource\\apps\\avkon2.mbm"</code></p>

<p>OK, you should be ready to change the code now.</p>]]>
    </content>
</entry>

<entry>
    <title>Porting to Nokia 7710</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2006/11/porting-to-nokia-7710.html" />
    <id>tag:symbian.compactbyte.com,2006://1.13</id>

    <published>2006-11-13T10:38:01Z</published>
    <updated>2009-07-01T11:13:12Z</updated>

    <summary>Someone just lend me a Nokia 7710 for the development of Symbian bible. Nokia 7710 is the only phone on the Series 90, and is the last Symbian UI from Nokia that has not been supported by Symbian Bible. Porting...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>Someone just lend me a Nokia 7710 for the development of Symbian bible. Nokia 7710 is the only phone on the Series 90, and is the last Symbian UI from Nokia that has not been supported by Symbian Bible. Porting to this platform is quite easy since it has almos the same concept with the Series 80, I only need to change a small amount of code to get it working.</p>

<p>The difficult part is how to get everything works comfortably for the user. Using Nokia 9300, in full screen mode I can still access the CBA using the hardware key, but on Nokia 7710 this is impossible (the CBA is virtual). My solution was to move some the CBA functionality (goto verse and history) to button A and B (the did not document this button, the code is <code>EStdKeyDevice4</code> and <code>EStdKeyDevice5</code>), and to togle fullscreen I use the Escape Key (the right bottom button, the keycode is <code>EStdKeyEscape</code>). </p>

<p>You must also be careful if you are using the joystick on the Nokia 9300, the scan code for the center/fire key on the Nokia 7710 corresponds to the right joystick key on Nokia 9300 (i was surpised because hitting the fire key advances the verse one line ahead).</p>]]>
        
    </content>
</entry>

<entry>
    <title>Strange font related bug on Nokia E61</title>
    <link rel="alternate" type="text/html" href="http://symbian.compactbyte.com/2006/11/strange-font-related-bug-on-series-60.html" />
    <id>tag:symbian.compactbyte.com,2006://1.12</id>

    <published>2006-11-13T10:14:12Z</published>
    <updated>2009-07-01T11:13:12Z</updated>

    <summary>I haven&apos;t looked at this bug very far, but when I load Gulim font (a Chinese font without latin glyphs, I converted it from a free font on the Internet), the messaging application does not display anything when I open...</summary>
    <author>
        <name>Yohanes Nugroho</name>
        
    </author>
    
        <category term="General" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en-US" xml:base="http://symbian.compactbyte.com/">
        <![CDATA[<p>I haven't looked at this bug very far, but when I load Gulim font (a Chinese font without latin glyphs, I converted it from a free font on the Internet), the messaging application does not display anything when I open a message (the list is fine). After I tested pasting Chinese bible text from S60Bible, I noticed that the messaging application is using the gulim font (so I can see the Chinese txt).</p>

<p>I am loading the font using this code:<br />
<code><br />
for (TInt i = 0; i &lt; entries-&gt;Count(); ++i)<br />
{<br />
Int id = 0;<br />
tmpFontPath.Copy(KFontDir);<br />
tmpFontPath.Append((*entries)[i].iName);<br />
CEikonEnv::Static()-&gt;screendevice ()-&gt;AddFile(tmpFontPath, id);<br />
}<br />
</code></p>

<p>Can it be because of the ID (I am just starting from 0). If I can change a font for other application, can I change the system font?</p>

<p>I will try to solve this later at home.</p>

<p><strong>Update</strong>: This is the problem:</p>

<p>http://www3.symbian.com/faq.nsf/0/BA5F628A350FBFEB80257336001D0C68?OpenDocument</p>]]>
        
    </content>
</entry>

</feed>
