Friday, June 27, 2008

How to Open Browser with a url in UIQ3.x

OpenBrowserWithUrlL(const TDesC& aUrl, CCoeEnv& aCoeEnv)
{
TVwsViewId id( KUidQWebApp, KUidQWebPageView);
TQWebDNLUrlEntry obj;
obj.iUrl = aUrl;
TQWebDNLUrlEntryBuf buf(obj);
aCoeEnv.AppUi()->ActivateViewL(id, KQWebCustomMsgId, buf);
}

Thursday, June 26, 2008

Auto-start In UIQ

The auto starter in UIQ did not have any particular order

To register with the auto starter your application must write a .ast file to the auto starter's import folder [\private\10274b9f]. On start-up the auto launcher parses the .ast files and will then add new ast files to its database of applications to be started. The ast format contains only the .exe name in plain text as the following example indicates:
calc.ast:

calc.exe

Note:
1. No path is needed: the file is a plain text, one-line executable name. The auto launcher will look across different drives for the executable to launch and no path need be specified; if you install to a MS then the auto launcher will launch from the MS; if the executable cannot be found it will be ignored. The ast file must be written (either by the application or via SIS) to the following import folder:- c:\private\10274b9f\import\

2. Security : The Auto starter will only start your application if it has the capability "WriteUserData".

Using Linux(Ubuntu) for Symbian.C++ 3rd edition application


Below are the steps i followed.
Step 1: Setup EPOCROOT and Points where you have symbian tools.
a) export PATH=~/gnupoc:${PATH}
b) export EPOCROOT=~/symbian-sdks/s60_31/

Step 2: Compile source code
a) cd ~/symbian-sdks/s60_31/s60ex/helloworldbasic/group
b) bldmake bldfiles
c) abld build gcce urel

Step 3: Create a SIS File
a) cd ../sis
b) makesis helloworldbasic_gcce.pkg helloworldbasic.sis

Step 4: Genearet key and certificate pair
makekeys -cert myselfcer.key myselfcer.cer

Step 5: Sign SIS
signsis helloworldbasic.sis helloworldbasic.sisx myselfcer.cer myselfcer.key
Setting Up a Symbian C++ Development Environment with Linux(Ubuntu)

Below are the steps i followed.

Step 1: Install Ubuntu 8.04 on a 32Bit system.

Step 2: The Default Ubuntu Install does not come with any Development Tools so you have to use ubuntu apt-get command to install tools and libraries we require.
a) sudo apt-get install build-essential [Compiler to build symbian build system ]
b) sudo apt-get install zlib1g zlib1g-dev [ZLIB Header files needed while building symbian build system ]
c) sudo apt-get install libssl-dev [OpenSSL Header files needed while building symbian build system (signsis / createsis etc)]
d) sudo apt-get install flex [Requred if you want to compile the gcce cross compiler on your own].
e) sudo apt-get install bison [Requred if you want to compile the gcce cross compiler on your own].

Step 3: You have to download some build scripts, compiler [/code] and SDKs
a) gnupoc-package latest. {http://www.4shared.com/account/file/52785287/c117ddb6/gnupoc-package-109tar.html}[It will contain the EKA2 and EKA1 toolchain].
b) gcc cross compiler for symbian source. {http://www.symbianos.org/download/gcc-539-2aeh-source.tar.bz2} [If you are compiling for Pre-v9 devices]
c) gcce cross compiler for symbian source. {http://www.codesourcery.com/gnu_toolchains/arm/releases/2005Q1C} [If you are compiling for 9.x devices]
d) gcc and gcce cross compiler binaries for symbian [If you donot want to compile gcc / gcce from source]
i. http://www.4shared.com/account/file/52785285/2f19bc9a/gnu-csl-arm-2005Q1C-arm-none-symbianelf-i686-pc-linux-gnutar.html

Step 4: Copy all downloaded files [step 3] files to "~/" of your system.

Step 5: Install symbian install Scripts for linux:
tar -zxvf gnupoc-package-1.09.tar.gz

Step 6: Install ARM Build system
If you want to compile tools your self:
a) cd gnupoc-package-1.09/tools
b) ./install_gcc_539 ../../gcc-539-2aeh-source.tar.bz2 ~/symbian-gcc [If using for EKA1]
c) ./install_csl_gcc ../../gnu-csl-arm-2005Q1C-arm-none-symbianelf.src.tar.bz2 ~/csl-gcc [If using for EKA2]

If you want to use pre-compiles tools:
a) mkdir csl-gcc
b) cd csl-gcc
c) tar -jxvf ../gnu-csl-arm-2005Q1C-arm-none-symbianelf-i686-pc-linux-gnu.tar.bz2

Step 7: Install remaining tools
a) cd gnupoc-package-1.09/tools
b) ./install_eka1_tools ~/symbian-gcc [If using for EKA2]
b) ./install_eka2_tools ~/csl-gcc [If using for EKA2]

Step 8: To Set Evenvironment variable to point to your SDK and add the toolchain directory.
./install_wrapper ~/gnupoc

What you can't do with this method:
1. you can't build for emulator.
2. you can't run emulator.

Note:
1. I don't mind using any other Ubuntu linux infect i have tried using OpenSuse and RedHat. Will post the steps for OpenSuse Soon.
2. Some of the sort comes like emulator specific can be over come with WINE will post how to use WINE in coming posts.
2. Refer to http://martin.st/symbian/ for more info.
3. Contact me at skumar.mobiledev@gmail.com with Subject [symbian on linux] if you have any problem.
How to launch a UI application with Arguments and Handle in Launched UI application

H to launch a application with Arguments.

LaunchApplicationWithArgumentL(const TDesC& aExeName, const TDesC8& aArg = KNullDesC8())
{
CApaCommandLine* commandLine = CApaCommandLine::NewLC();
commandLine->SetCommandL(EApaCommandRun);
commandLine->SetExecutableNameL(aExecName);
commandLine->SetTailEndL(aArg);
RApaLsSession apaLsSession;
User::LeaveIfError(apaLsSession.Connect());
CleanupClosePushL(apaLsSession);
User::LeaveIfError(apaLsSession.StartApp(*commandLine));
CleanupStack::PopAndDestroy();
CleanupStack::PopAndDestroy(commandLine);
}


Handle Arguments in UI Application.

Over ride the virtual function ProcessCommandParametersL() of AppUi Class. 3rd parameter of the function aTail contains application parameters

TBool CMySymbianAppUi::ProcessCommandParametersL(TApaCommand aCommand, TFileName &aDocumentName, const TDesC8 &aTail)
{
iLogger.WriteFormat(_L("ProcessCommandParametersL %d"), aTail.Length());
}

Friday, June 13, 2008

What does the Application framework takes care while launching an application ?

The Framework will do following before starting the application.
    1. Create a connection to the file server.
    2. Create a connection to the window server.
    3. Create a connection to the memory manager.
    4. Do some application registration.
    5. Make sure the application is able to handle erroe and out-of-memory situtions.
    6. Initalize other application services like font etc.
    7. create default screen elements like status bar, menu bar, soft keys etc.
    8. Start active scheduler. (or you can send event loop)
What the term "Downgrade path" mean in UIQ3.

If a application is not coded to work on all available "UI Configurations" the UIQ3 UI framework will try to look for a nearest match and configures the Screen to that configuration, this process is called "Downgrade path".

"Downgrade path" also makes it possible for an application to run on a device which has a UI configuration that was not available at the time the application was written.

Thursday, June 12, 2008

How to configure UIQ3 emulator to a specific "UI Configuration" ?

When launching the emulator we have to pass -ui parameter to it get the desired "UI Configuration"
eg. uiqenv -ui softkey
OR
We can use the SDKConfig application provided by the SDK.
What does UIQ3 UI Configuration is consist of ?

UI of UIQ3 is very versatile and can be configured by a 4 high-level configuration parameters. Combination all these parameters are called a UI configuration.
    1. Screen Mode.
        The following resolutions are commonly used.
        a) Portrait (QVGA, 240x320 pixels)
        b) Landscape (QVGA, 320x240 pixels)
        c) Portrait Small(240x256 pixels)
        d) Landscape Small(256x240 pixels)
    2. Screen orientation.
        Indicates whether screen is used in
        a) Normal Mode.
        b) Inverted Mode. (screen roated in 180 degrees)
    3. Touch Screen.
        Indicates whether to use advanced digitizer (Touch Screen) or Not.
    4. Interaction style.
        There are 2 general interaction styles used.
        a) Pen-Style. Optimized for pen use. also know as (Point Touch method)
        b) Softkey-Style. Optimized for one-handed navigation.
        
UI Configurations are enumerated in "Qikon.hrh" as

#define KQikSoftkeyStylePortrait (EQikScreenModePortrait  | EQikTouchScreenNo | EQikUiStyleSoftkey | EQikOrientationNormal)

As you can see the UI Configuration can have any combination above 4 parameters. But most commonly used paramets are
    a) KQikSoftkeyStylePortrait. Generally known as "SoftKey Style"
    b) KQikPenTouchPortrait. Generally known as "Pen Style".
What a UIQ3 SDK contains ?

    1. Library, header and binary files.
    2. Compilers 
        a) GCCE compiler for device build,
        b) Nokia x86 compiler for emulator builds.
    3. Tools and scripts (including perl scripts) for building application in C++ and creating installation files to distribute applications.
    4. PC-Based emulator (No Simulator) of the UIQ3 platform to enable fast development and turn around time.
    5. Documentation.
        a) API reference.
        b) Guides.
        c) Sample code.

stats counter