Showing posts with label Symbian. Show all posts
Showing posts with label Symbian. Show all posts

Friday, February 27, 2009

Hi All,
Today I will be discussing the type of files used in Symbian.
My intention is to provide a handbook like structure for definitions of various types of files used in Symbian.
(File means not the usual file system topic but rather the various files used such as rss,hrh,..etc)

List of Files in Symbian
CPP,Header files(.h)
RSS file Resource file.It contains resource definitions for UI related things like menu, dailogs etc. On compilation 2 files are generated (rsg & rsc)
RSG file It is a header specifying resource identifier. To be included by the cpp files for UI identifiers.It will be present in \epoc32\include
RSC file The binary code for the rss file.(Object code)

BMP file Image file format.Used commonly across all platforms.
MBM file Symbian bitmap files. Symbian understands MBM format. Multiple bitmap files can be embedded within one BMP.
MBG file Its a dynamically created header-file used by the application. (same like RSG concept). To be included by the cpp or rss file if bitmap images are used.

HRH file Enum declarations that are used in resource files,cpp and the normal header files are done here.

LOC file Used for localization.Strings which are used in rss file should be #defined in LOC files if your applications needs to support variety of language.
RLS file Same as loc files. Only difference is the syntax used. Instead of #define we use rls_string id.

MMP file Make file. Used to specify header file locations, source code to be compiled, library to be linked, UID value assignment etc

DEF file It's used for libraries (dll). The file contains the mapping of exported function to a ordinal number.abld freeze generates def file. It's used for BC (backward compatibility)

IBY file contains files which needs to be placed in the mobile(The destination path is mentioned along with the source path in the work space)

My team mate Jagamohan has reviewed this topic and I thank him for corrections.

Monday, February 9, 2009

Central Repository

I have decided to blog on Symbian , based on my work experience.
Symbian is an Operating System for Mobiles.
Please Google out Symbian for more information.
Thereby I am directly blogging on a topic called Central Repository and not focusing on Symbian OS essentials.

Central Repository is a mechanism to save Data permanently in mobiles. Can be viewed as Global Data but very much secured.Data is in the form of int, float and string. Applications can store data using Central Repository.

We also have a mechanism named as RProperty which is not persistent type of storage.Its a temporary mechanism to store the data. Data is valid for the present boot. Loose the content as soon as the system shuts down whereas Central Repository stores permanently.

Temporary data can be saved in RProperty and while turning the device OFF, can shift the data from RProperty to Central Repository.

If a factory reset is performed, then we have the option to retain the latest value of the data or the data can hold the initial value.For data to hold initial value, RFS setting of the data should be set. Overhead is that for every factory reset, additional time is required as Initial value of data should be restored.

While creating a central repository item, settings can be attributed to the item. As mentioned before one can have the option of RFs as well as back up,read write permission (security aspect) etc.

Following is the procedure to use Central Repository.

Step 1 : Create uid3.txt and export it to Z:
Step 2 : uid3.txt contains number of keys and initial attributes
Step 3 : From source code ; create a handle to access central repository.
Step 4 :If necessary change the attribute on the FLY.
Step 5 :Central Repository exposes a set of APIs to manipulate the data.
Step 6 :The storage data types are int,real,strings and binary.


The application uid can be used to create the text file. A file can have 2^32 number of keys.

Export the txt file from your project location to
\epoc32\RELEASE\WINSCW\UDEB\Z\private\10202be9\

The format of txt file is as below
----------------------Start of txt file------------------------

cenrep
version 1
[owner]
//uid of ur apps
0x101F6CFE
[defaultmeta]
0
[platsec]
//Attribute to the whole file
cap_rd=alwayspass cap_wr=WriteDeviceData
[Main]
//Attribute to individual key
//key 1
0x1 string "0" 0 cap_rd=alwayspass cap_wr=WriteDeviceData
//key 2
0x2 int 0 16777216 cap_rd=ReadDeviceData cap_wr=WriteDeviceData

-------------------------------End of txt file----------------------

To access central repository from source code

-----------------------.cpp-------------------------------
TUid Uid;
//uid of your app
Uid::TUid(0x101F6CFE);
//create a handle
iCenRep = CRepository::NewL(Uid);
if (iCenrep)
{
//data to hold value
TInt val;
//Now val holds the latest value of key 0x2 i.e 0 since we have assigned 0 in txt file
iCenRep.Get (0x2,val);
//Set the key 0x2 to some other value
iCenRep.Set (0x2,10);
//now val has the value 10
iCenRep.Get (0x2,val);
}
----------------------------------------------------------
My team mate Jagamohan has reviewed this topic and I thank him for corrections.