Thursday, October 8, 2009

Tweak Central Repository

Just like Registry on Windows OS, Central Repository is used on Symbian for storing system-wide settings. Some settings are non-modifiable via program (unless on hacked phones). Here is one of the examples:

修改開機鈴聲(10秒限制)- 不是高手切勿修改
雖然可以替換沈悶的開機鈴聲,但仍有10秒的長度限制(也很足夠啦),而且替換的不是 MIDI,而是 MP3 或 AAC﹗教程︰

1 - 首先你必須是破解閱讀權限的手機 ,大致上的3版手機都是支持的
2 - 然后安裝個文件管理軟件 (如 ︰X-Plore)打開 Z:/private/10202be9/ 然后複製 101F8763.txt 去記憶卡
3 - 打開這個文件你會看到以下的內容 (這個是N95的內容 ,可能和其他的手機會不同)
cenrep
version 1
[owner]
0x100059C9
[defaultmeta]
0
[platsec]
cap_rd=alwayspass cap_wr=WriteDeviceData
[Main]
0x1 int 1 0 cap_rd=alwayspass cap_wr=alwaysfail
0x2 int 4 0 cap_rd=alwayspass cap_wr=alwaysfail
0x3 string "[color=red]Z:\\system\\sounds\\Wakeup tone.aac[/color]" 0 cap_rd=alwayspass cap_wr=alwaysfail
0x4 string "" 16777216 cap_rd=alwayspass cap_wr=WriteDeviceData
0x5 string "" 16777216 cap_rd=alwayspass cap_wr=WriteDeviceData
0x6 int 0 16777216 cap_rd=alwayspass cap_wr=WriteDeviceData
0x7 string "" 0 cap_rd=alwayspass cap_wr=alwaysfail
0x8 string "" 0 cap_rd=alwayspass cap_wr=alwaysfail
0x9 string "" 0 cap_rd=alwayspass cap_wr=alwaysfail
0xA int 1 0 cap_rd=alwayspass cap_wr=alwaysfail
0x101 int 30000 0 cap_rd=alwayspass cap_wr=alwaysfail
0x102 int 0 0 cap_rd=alwayspass sid_wr=0x100059C9
0x103 int 5 0 cap_rd=alwayspass cap_wr=alwaysfail
4 - 把 Z:\\system\\sounds\\Wakeup tone.aac 修改成 E:\\Sounds\\Simple\\Startup.mp3 然后儲存(切記 ︰其他的不用修改和注意空格)
5 - 另開一個文件夾名字為 10202be9 把修改后的 101F8763.txt 複製進去
6 - 把 10202be9 覆蓋到 c:/private 文件夾裡面
7 - 把一首 10 秒鐘的歌曲複製到 c︰sounds/simple 裡面就完成了
現在關機然后開機就會聽到自編輯的歌曲羅﹗﹗

文章來自http://www.s603rd.cn

Monday, February 18, 2008

SMS Transferring

If you prefer to store messages on phone memory, you will need three phones to do the transfer, otherwise you don't need a middle-phone:
  • source phone - 2nd Ed (ex. my N70),

  • destination phone - 3rd Ed (ex. 6120 classic), and

  • middle phone - 3rd Ed (ex. my E50).

Steps:
  1. On your source and middle phones, set memory card as storage for messages. On destination phone, set that to phone memory. To change the settings, go to Messaging > Options > Settings > Other > Memory in use > [memory card]. You will be prompt to copy message or not. Select yes for the source phone and yes for keep original. For others, up to your preferences.

  2. After the copying is completed, read the memory card with a computer and copy the folder \system\mail\ to your computer (always as a backup). Now, you can put the source phone and its memory card away.

  3. Access the memory card of your middle device, browse to \private\1000484b\. You will find a "Mail2" folder, rename it to anything. Copy your "Mail" folder and rename that to "Mail2". Insert the card back into the phone. Now, you can access all messages, SMS, MMS, Bluetooth and Infrared.. etc, on your middle phone.

  4. Last step is simple, open the Transfer program on both 3rd Ed. phones, set up a sync profile between your destination phone and the middle phone, and synchronize text messsages. Done.

Friday, February 15, 2008

Backup, Restore, XML

By default, backup and restore of application are not supported in S60 3rd Edition. Each application must include a file, backup_registration.xml, to register itself in the backup/restore process. However, none of the examples in SDK provide a good enough registration file - all of them only work for simple applications. Below are some URLs I found these days:

Symbian.com: How-To Write Backup-aware Software
- official documentation on backup and restore. But it's hard to understand and too deep into the underlying but too little about the XML.

Forum Nokia: nokia n95 full backup program
- this is where I start to find some useful information on the XML.

Forum Nokia: How to backup/restore themes in Symbian v.9.x based devices?
- for theme creators. But I wonder, how to put the XML in Carbide.ui Theme Edition 3.2?

NewLC.com: How to enable backup and restore for Symbian OS applications
- the best place to look for Symbian C++ sample codes.

Wiki of FN: Enabling backup and restore for installed C++ applications
- the example in this page is the best so far.


Here is my XML file:
<?xml version="1.0" standalone="yes" ?>
<backup_registration>
<system_backup />
<passive_backup>
<include_directory name="\" />
</passive_backup>
<public_backup>
<include_directory name="C:\PATH1\UID" />
<include_directory name="C:\PATH2\UID" />
</public_backup>
<restore requires_reboot="no" />
</backup_registration>

Friday, January 11, 2008

Small Status Pane

Symbian S60 status pane occupies one-fifth of the screen, which is a lot of space. Programmer can disable it by one of the following methods:
  1. CCoeControl::SetExtentToWholeScreen() (during construction of the CCoeControl). It expands to full screen, but CBA pane is gone and skin background won't work properly.
  2. CEikStatusPane::MakeVisible(EFalse). It hides the status pane, CBA pane remains but the skin background still won't work properly.

The Menu and Web (application) on S60 3rd phone suggest that there should be a standard API which can reduce the status bar but show necessary or critical information. It took me a while to find something useful:
They are same except different in titles and first lines. Based on their suggestion, the simpliest way to reduce the status pane is:
    StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_SMALL );
If you call CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain, Rect(), EFalse) after switching the layout, the skin background should work fine in both portrait and landscape mode. Note that in landscape mode, the status pane is already in minimum size. So, SwitchLayoutL might have no effects for landscape.

However, this resource id will only give a blank status pane. If the signal icon is desired, as it's useful when accessing Internet, use R_AVKON_STATUS_PANE_LAYOUT_SMALL_WITH_SIGNAL_PANE. Check out more in the avkon.rsg.


My app with small status pane. Skin background is working. However, it does not display the app title.

If you want to have the same mane pane as the menu, signal + battery + title, use R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT.

Silent the Keytone

This is a summary of post from Forum Nokia: Turning off key sounds programatically. Code can be added to MyProjectAppUi.cpp.

#include <avkon.rsg>

KeySounds()->PushContextL( R_AVKON_SILENT_SKEY_LIST );

To restore, call KeySounds()->PopContext(). One thing noticed, press LSK hear no keytone. When Options menu is displaying, keytone comes back.

This keytone-silent feature should be useful for games, as players might not want to have keytones during a game play but when normal use of the phone. Pressing the key and hearing the beep-beep-beep-beep is kinda annoying. Of course, the sound engines of game might already prevent the keytone beeping.