Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Revision as of 04:40, 18 June 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Porting iPhone native (Objective-C) applications to S60 5th Edition

From Wiki
Jump to: navigation, search
Article Metadata
Compatibility
Platform(s):
S60 5th Edition
Article
Created: jaaura (06 Apr 2009)
Last edited: hamishwillee (18 Jun 2013)

Contents

Introduction

When someone familiar with developing for iPhone (Mac Os) Os moves to developing for Symbian OS, there is a period of uncertainty about where to start. The APIs, tools and development environments are so dissimilar that it comes as quite a shock to many.

This article is meant to provide beginning and intermediate iPhone Os developers with an introduction to porting applications from iPhone to Symbian OS v9.x.

Iphone.JPGNokia-n97-2.jpg

The source porting should be rather easy, considering the similarities in functions provided by the languages, and the biggest differences in the code will appear in the GUI section.

iPhone OS development, as most of Mac development, is usually extensively based on MVC pattern. Thanks to this, most of the porting work should concern the graphical interface, while the model and controller part should remain close to basic translation, following the rules described bellow.

Of course, the more specific iPhone functions used, the more complex the port (GPS use, accelerator integration, SQLite data storage ...).

Overview of iPhone OS and Symbian OS

iPhone OS Architecture Overview

IPhone Arc.jpg


Symbian OS Architecture Overview

Symbian Arc.png

Languages Used for Native Development

iPhone OS: Objective-C

Symbian OS: Symbian C++

Getting Started

IDEs


Code: Similarities and differences

Let's take a look at some code. The following table compares a code with the same logic written in Objective-C and Symbian/C++. The first thing to notice is that it is necessary to write some more lines of code in Symbian/C++ if compared to Objective-C. This is because some coding conventions that are used in Symbian/C++ and that characterize the way of programing. It is worth mention that Symbian/C++ is C++ with some coding convention that are related to memory management, naming of elements (classes, variables ...), etc. In the next lines the similarities among the languages will be highlighted.

NOTE: If you are not familiarized with C++ this can be a start point, but it is really recommended more information about the topic <<insert useful link here>>. The comparisons will be among Objective-C with C++ and Symbian/C++ (that involves the coding conventions)

Similarities

  • The basic similarity is that both languages Objective-C and C++ came from the necessity to increment the C language with support to object oriented skills.
  • Other aspect is that both languages uses the same extensions for the files designed to have the classes declarations: .h. Regarding the source file, Objective-C uses the extension .mm and C++ uses the extension .cpp
  • In both languages there is a clear separation between classes declarations and implementations. The separation is clear on the code where it can be seen '@interface' keyword of Objective-C matching the 'class' keyword of C++. In fact, except the code added for object construction of Symbian/C++ every line of code of the Brad Cox's language (creator of Objective-C) has a very similar line of code in C++.
  • The scope delimiter of the instance variables are also the same, i.e., @private, @protected and @public delimiters are available in C++.
  • Other similarity is that in Symbian/C++ there is also a common base class 'CBase', similar to 'NSObject', that is used in all classes of type 'C'. In Symbian/C++ every class has a type. The 'C' classes are dynamic allocated on heap and have a special construction mechanism called Two-phase construction. Besides this type are others like 'T' classes that are usually used for stack based objects. More information regarding the types of classes of Symbian/C++ can be found here

Differences

  • There is no standard way to synthesize methods in C++. So every @property on Obj-C code has to be implemented. In this case the property myProperty has the equivalent methods TInt myProperty() and void setMyProperty(TInt property).
  • Static methods are declared with a static keyword in C++ instead of + sign in Cbj-C. Regarding the variables the same keyword is used in both cases.
  • You need to write special code for object construction in classes of type C. This special code is called two phase construnction. The first construction step consist of calling the C++ constructor that shouldn't alloc any resource. In the second phase, you call the method ConstructL that effectively alloc the resources for the object. Also, in the wo phase construction you should be aware of the cleanup stack mechanism that Symbian adopts and use it accordingly (see Cleanupstack).


iPhone Symbian/S60

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


#import <NSObject.h>

@class Bar;
@interface Foo : NSObject
{
@private
    double x;
    Bar* mybar;
    int myProperty;
}

@property int myProperty;

-(void) useBar;
     
-(int) doSomething:(int)arg;
     
-(int) doOtherThing:(int)arg1 :(int)arg2;

+(double) doThingsForThisClass:(double)arg;

@end
     
@implementation Foo


@synthesize myProperty;

-(void) useBar
{

}
     
-(int) doSomething:(int)arg 
{
      return arg;
}
   
-(int) doOtherThing:(int)arg1 :(int)arg2 
{
      return arg1+arg2;
}

+(double) doThingsForThisClass:(double)arg
{
      return arg;
}
@end
#ifndef __FOO_H__
#define __FOO_H__
 
#include <e32def.h>
 
class CBar;
 
class CFoo : public CBase
{
private:
TReal iX;
CBar* iMyBar;
TInt iMyProperty;
 
/* Code added for object construction
in Symbian/C++*/

CFoo(){};
void ConstructL(){};
public:
/* Code added for object construction
in Symbian/C++*/

static CFoo * NewL();
 
TInt myProperty();
void setMyProperty(TInt property);
 
void useBar();
 
TInt doSomething(TInt arg);
 
TInt doOtherThing(TInt arg1, TInt arg2);
 
static TReal doThingsForThisClass(
TReal arg);
};
 
/* Code added for object construction
in Symbian/C++*/

 
CFoo* CFoo::NewL()
{
CFoo* instance = new (ELeave) CFoo;
. . .
instance->ConstructL();
. . .
return instance;
}
 
TInt Foo::myProperty()
{
return myProperty;
}
 
void Foo::setMyProperty(TInt property)
{
iMyProperty = property;
}
 
void Foo::useBar()
{
}
 
TInt Foo::doSomething(TInt arg)
{
return arg;
}
 
TInt Foo::doOtherThing(TInt arg1,TInt arg2)
{
return arg1+arg2;
}
 
TReal Foo::doThingsForThisClass(TReal arg)
{
return arg;
}
 
#endif

Key Points to Remember

  • Use #include instead of #import in Symbian C++
  • Use NULL instead of nil in Symbian C++
  • It is really a good practice to separate the UI and Engine part of the code separately following the MVC Design Patterns in Symbian .


Methods

iPhone Objective-C Messages Symbian/S60

Objective-C Example:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


   /* Objective-C is a language with
      “function calls using brackets”.
      [object doSomething]; ;*/

   [receiver message];

To get an object to do something, programmer has to send it a message telling it to apply a method.

Note: The receiver is an object, and the message tells it what to do.

Symbian C++ Example:

   /* Symbian C++ is a language with
“function calls using parentheses”.
object.doSomething();*/

 
Receiver* receiver = new(ELeave) Receiver();
receiver->Message();
 
// deletion of the allocated object
delete receiver;
receiver = NULL;

Methods With Arguments

iPhone Symbian/S60

Syntax:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


[receiver meassage:Argument1];

Obective-C Example:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// example 1
[myRectangle setWidth:20.0];

// example 2
[myRectangle setOriginX: 30.0 Y: 50.0];

Symbian C++ Example:

TRect rect(0,0,0,0);
 
rect.SetRect(10,20,30,40);

Nested Messages

iPhone Symbian/S60

Objective-C Example:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


[myRectangle setPrimaryColor:[otherRect primaryColor]];

One message expression can be nested inside another.

Symbian C++ Example:

TRect rectA(10,20,30,40);
rectA.SetSize(TSize(30,40));

Allocation Of Object

iPhone Symbian/S60

Objective-C Example:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


Object *object = [[Object alloc] init];

There is also an autorelease pool that can be used to avoid manual desallocation, but it must be used with caution, since desallocation occurs at the end of the context (useally as the method returns), while you may need to desallocate it sooner for many reasons.

Symbian C++ Example:

Object *object = new(Eleave) Object();

Deallocation Of Object

iPhone Symbian/S60

Objective-C Example:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, algol68, apache, applescript, apt_sources, asm, asp, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, c_loadrunner, c_mac, caddcl, cadlisp, cfdg, cfm, chaiscript, cil, clojure, cmake, cobol, coffeescript, cpp, cpp-qt, csharp, css, cuesheet, d, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, f1, falcon, fo, fortran, freebasic, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, j, java, java5, javascript, jquery, kixtart, klonec, klonecpp, latex, lb, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, newlisp, nsis, oberon2, objc, objeck, ocaml, ocaml-brief, oobas, oracle11, oracle8, oxygene, oz, pascal, pcre, per, perl, perl6, pf, php, php-brief, pic16, pike, pixelbender, pli, plsql, postgresql, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, python, q, qbasic, rails, rebol, reg, robots, rpmspec, rsplus, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, uscript, vala, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xorg_conf, xpp, yaml, z80, zxbasic


// deallocation of objects
[object release] ;
[super dealloc];

In second line we are sending a message to a superclass NSObject in most of the case to do its cleanup. If we dont do this the object will not remove and it is a memory leak.

Symbian C++ Example:

delete object;
object = NULL;

Porting Application to Symbian

iPhone

List of files look like in Xcode
IphonesFiles.jpg

Symbian/S60

iPhone Interface Builder iPhone:

Every project gets one nib file by called which is called "MainWindow.xib" which can be found under "Resources". An iPhone application has only one window (MainWindow.xib).Double click on "MainWindow.xib" to launch the Interface Builder, which will open four windows and one of the window will look like this.

Every nib file has atleast two files.File's Owner and First Responder which cannot be deleted. Every other objects apart from the first two, represents an instance of an object which gets created when the nib file loads.

  • File's Owner simply shows that it owns the object in the nib file.
  • First Responder tells us which object are we currently interacting with; like the textbox, buttons...
  • The third object which is special to the MainWindow.xib file is called "Hello Universe App Delegate" and this file represents "HelloUniverseAppDelegate" class. Last but not the least the view represents the object which we design in our apps.


InterfaceBuilder.jpg

Symbian/S60


Main Function

iPhone Symbian/S60
#import <UIKit/UIKit.h>
int main(int argc, char *argv[])
{
NSAutoreleasePool * pool =
[[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(
argc, argv, nil, nil);
[pool release];
return retVal;
}
#include <eikstart.h>
#include "CUSSDApplication.h"
 
LOCAL_C CApaApplication* NewApplication()
{
return new CMyApplication;
}
/* Entry Point for Symbian GUI */
 
GLDEF_C TInt E32Main()
{
return EikStart::RunApplication(
NewApplication );
}

Porting GUI Application to Symbian

GUI Overview



File:Iphone ui.jpg?File:Symbian ui.jpg?

Symbian/S60

Orientation In UI Application

iPhone

The UIInterfaceOrientation key provides a hint to iPhone OS.

Symbian/S60

Graphics And Drawing

iPhone

  • iPhone OS supports drawing through the OpenGL ES (OpenGL ES v1.1),Quartz,UIKit, or Core Animationframework. The UIView class makes the update process easier and more efficient.

Symbian/S60

  • S60 has the support of OpenGL ES.


Supported Images

Format Extension iPhone S60
Portable Network Graphic(PNG) .png yes yes
Tagged Image File Format(TIFF) .tiff, .tif yes
Joint Photographic Experts Group(JPEG) .jpeg, .jpg yes yes
Graphic Interchange Format(GIF) .gif yes yes
Windows Bitmap Format (DIB) .bmp, .BMPf yes yes
Windows Icon Format .ico yes
Windows Cursor .cur yes
XWindow bitmap .xbm yes
MBM .mbm no yes


Simple Graphics API

iPhone Use S60
UIImage class for displaying images CFbsBitmap,CGulIcon
UIColor provides basic support for device colors TRgb
UIFont font information CFont
UIScreen provides basic information about the screen CWsScreenDevice

Event Handling

iPhone

  • Does Not Support the Key Events.

Symbian/S60

DataBase Handling

iPhone

Symbian/S60

Communication Handling

iPhone

Apple provides built-in support for the http, mailto, tel, and sms URL schemes. It also supports http–based URLs targeted at the Maps, YouTube, and iPod applications. Applications can register their own custom URL schemes as well. To communicate with an application, create an NSURL object with some properly formatted content and pass it to the openURL: method of the shared UIApplication object.

Symbian/S60



InterProcess Communication

Sensor Handling

iPhone

Symbian/S60

MultiMedia Framework

iPhone

Symbian/S60

XML Handling

iPhone

Symbian/S60

Security Framework

iPhone

Symbian/S60

Application Signing Overview

iPhone

Symbian/S60

Application Bundle

Objective-C Symbian C++ Remarks
MyApp.app MyApp.exe The executable file containing your application’s code.
Icon.png Icon.mbm Represent your application on the device home screen.
MainWindow.nib MainWindow.rss Typically, this nib file contains the application’s main window object.This could be compared to Symbian Resource file but to a full extent.
Info.plist Symbian Package file. information property list, this file is a property list defining key values for the application, such as bundle ID, version number, and display name

en.lproj fr.lproj es.lproj

en.l01 fr.l01 es.l01

Localized resources.
MyApp.app MyApp.SISX Final ouput file .

Technical References

External

Internal

Introductory References

Signing And Security References

Binary Compatibility

Tools

Books

WebSites

This page was last modified on 18 June 2013, at 04:40.
114 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×