Posts filed under 'Symbian开发技巧'
I changed my laptop to IBM T400, and during my installation of the SDK/IDEs, I encountered several small problems, I posted here hope that would help if you encounter the same problem.
I installed S60 3rd FP1, S60 5th SDK, Carbide.c++ v1.3, and the problems are listed here:
1, “Call to RegDBQueryKey failed” when installing the SDK — you can ignore it
2, Add the following path to the Environment path Variable:
C:\Program Files\CSL Arm Toolchain\libexec\gcc\arm-none-symbianelf\3.4.3;C:\Program Files\CSL Arm Toolchain\arm-none-symbianelf\bin;C:\Program Files\CSL Arm Toolchain\bin;
3, The S60 5th SDK project template won’t appear when creating a new symbian project in Carbide.C++ v1.3, download TouchUI-Project Template , and copy the S60-TouchUIApplication directory to the following directory on your hard driver:
” C:\Program Files\Nokia\Carbide.c++ v1.3\plugins\com.nokia.cdt.templates_1.3.0.023\templates\com\nokia\cdt\templates\projecttemplates”
And replace the “plugin.properties” and “plugin.xml” at: “C:\Program Files\Nokia\Carbide.c++ v1.3\plugins\com.nokia.cdt.templates_1.3.0.023″
Popularity: 24% [?]
Tags: Carbide, CLS Arm Toolchain, project template, RegDBQueryKey, SDK, Symbian
12月 3rd, 2008
Using the following code you can detect that if a phone device has an internal GPS hardware.
You have to #include <lbs.h> and link against lbs.lib.
————————————————————
RPositionServer server;
TPositionModuleInfo modInfo;
User::LeaveIfError(server.Connect());
CleanupClosePushL(server);
TUint numModules;
User::LeaveIfError(server.GetNumModules(numModules));
for (TInt i = 0; i < numModules; i++)
{
User::LeaveIfError(server.GetModuleInfoByIndex(i, modInfo));
if ((modInfo.TechnologyType()
== TPositionModuleInfo::ETechnologyTerminal )
&& (modInfo.DeviceLocation()
== TPositionModuleInfo::EDeviceInternal ))
{
User::InfoPrint(_L(”Internal GPS Detected!”));
}
}
CleanupStack::PopAndDestroy(&server);
—————————————————————————
Popularity: 25% [?]
Tags: detect, gps, internal, RPositionServer, Symbian
11月 12th, 2008
When using a setting list, if you change to small font, the text will be displayed incorrectly! (Menu -> Tools -> Settings -> General -> Personalization -> Display -> Font size ).
This problem appears only on the Numbered Style Setting list, (EAknSettingItemNumberedStyle). The only way to make it look right should be not using this style…

Popularity: 33% [?]
Tags: landscape, setting list, small font, Symbian
06月 25th, 2008
Normally you should write a server to run in the background.
Anyway, with a normal app, you can do this by adding one line to your <appname>_reg.rss file.
RESOURCE APP_REGISTRATION_INFO
{
app_file=”hello_0xE67432E1″;
localisable_resource_file = qtn_loc_resource_file_1;
localisable_resource_id = R_LOCALISABLE_APP_INFO;
embeddability=KAppNotEmbeddable;
newfile=KAppDoesNotSupportNewFile;
hidden=KAppIsHidden;
}
Popularity: 31% [?]
Tags: app icon, hide, menu, Symbian
06月 15th, 2008
Got the following code snippet from forum nokia wiki , one thing to take care of is that you need the SwEvent capability when there is a browser already running!
void CBrowserAppUi::LaunchBrowserL(const TDesC& aUrl)
{
const TInt KBrowserUid = 0×10008D39;
TUid id( TUid::Uid( KBrowserUid ) );
TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
TApaTask task = taskList.FindApp( id );
if ( task.Exists() )
{
HBufC8* param = HBufC8::NewLC( aUrl.Length() + 2);
param->Des().Append(_L(“4 “));
param->Des().Append(aUrl);
//Need the WsEvent Capability
task.SendMessage( TUid::Uid( 0 ), *param ); // Uid is not used
CleanupStack::PopAndDestroy(param);
}
else
{
HBufC16* param = HBufC16::NewLC( aUrl.Length() + 2);
param->Des().Append(_L(“4 “));
param->Des().Append(aUrl);
RApaLsSession appArcSession;
User::LeaveIfError(appArcSession.Connect());
TThreadId id;
appArcSession.StartDocument( *param, TUid::Uid( KBrowserUid), id );
appArcSession.Close();
CleanupStack::PopAndDestroy(param);
}
}
Popularity: 30% [?]
Tags: api, browser, SwEvent, Symbian
06月 14th, 2008
They occur when the Viewsrv active object in your, or any other, application does not respond to the view server in time. Typically 10-20 seconds is the maximum allowed response time.
Guidelines for avoiding common causes of this problem:
1, Do not have long running synchronous operations. e.g. “while (1) { GameStep(); }”.
2, Ensure that your active objects don’t swamp the scheduler. The active scheduler processes active objects strictly in priority order, and for those of the same priority, active objects added first have priority. Active objects that run often and use a lot of processing time should run at low priority. The Viewsrv active object runs at CActive::EPriorityStandard, so busy active objects should run at a lower priority. One note of warning: if you use EPriorityLow, ensure it is scoped as CActive::EPriorityLow, otherwise you may get thread priority EPriorityLow, which is actually a very high priority value for an active object!
3) Allow some CPU time for other applications.
4) Do not use User::WaitForRequest();
5) On some platforms, be aware that launching waiting dialogs (or performing other blocking actions) from ViewActivatedL(); or ViewDeactivatedL(); can also cause Viewsrv 11 panics.
Assesmbled from here: http://www3.symbian.com/faq.nsf/0/894657c7845917a380256d98005baff7?OpenDocument
Popularity: 30% [?]
Tags: Active Object, CActive, Panic, Symbian, ViewSrv 11
04月 23rd, 2008
Today, I got my new application VibrateCall Symbian Express Signed!
Here are some tips to be careful with when you do it the first time!
1, You need to get a publisherID (200$) and a Content ID (20$)
2, Login to www.symbiansigned.com
3, The file you submit must be in ZIP format
4, The ZIP file must contain three files: pkg, readme.txt, sis (Can’t be sisx)
5, The sis file must be signed with the TCT Publisher ID (Not the cer file generated with the DevCert Tool)
6, The sis file in the zip can’t contain Manufacture proved capabilities, I suggest that you use the minimal set of capabilities used by your program — when you are coding, you had better write down what capabilities you used, for which API and the reason for it.
I tried four times before finally succeed, hope my experience can help you when you are Express sign your sis files the first time 
Popularity: 25% [?]
Tags: Express, Signed, Symbian, tips, VibrateCall
04月 1st, 2008
最近开发了几款基于传感器的应用(FlipSilent, ShakeSMS), 但是有些手机并没有传感器(如N73),所以如果在安装过程中可以区分一下可以使User Experience更好一点,N73用户也不用白白安装后试了半天才发现根本没有用。
一个比较简单的方法是在pkg文件根据手机型号(Product ID)中作判断,可以加上如下几行:
;Supports Series 60 v 3.0 //屏蔽掉原来的Platform ID
;[0×101F7961], 0, 0, 0, {”Series60ProductID”}
[0×20002D85], 0, 0, 0, {”Nokia N82 ID”}
[0×2000060B], 0, 0, 0, {”Nokia N95 ID”}
[0×20002D84], 0, 0, 0, {”Nokia N95 8GB ID”}
更多的ProductID和PlatformID参考这里:
这样,当N73安装过程中就会显示:

Popularity: 22% [?]
Tags: pkg, product id, specific device, Symbian
03月 13th, 2008
1, Outgoing Call
a, Dialing and hangup immediatly
EStatusDialing -> EStatusDisconnecting -> EStatusIdle
b, Dialing, ringing, ended
EStatusDialing -> EStatusConnecting -> EStatusDisconnecting -> EStatusIdle
c, Call Answered by the other one,
EStatusDialing -> EStatusConnecting -> EStatusConnected -> EStatusDisconnecting -> EStatusIdle
2, Incoming Call
a, Ringing, Hangup yourself / the other one
EStatusRinging -> EStatusDisconnecting -> EStatusIdle
b, Ringing, Answering, Hungup yourself / the other one
EStatusRinging -> EStatusAnswering -> EStatusDisconnecting -> EStatusIdle
Popularity: 20% [?]
Tags: Phone Call, State Machine
03月 10th, 2008
N95硬件中隐藏了一个加速度传感器(Accelerometers),该硬件来自STMicroelectronics,型号为LIS302DL。加速度传感器用于将重力或者运动加速度变换为电信号,Accelerometers很可能是继GPS之后的下一个重量级的硬件。Forum Nokia Wiki上有最权威的描述:http://wiki.forum.nokia.com/index.php/N95_sensor
Accelerometers API首先在NokiaResearchCenter(http://research.nokia.com/projects/activity_monitor)发布,目前可以支持N95,N95 8GB,N93i,N82等手机.该plug-in只能用于研究和开发用途,并含有如下Capabilities,根据Symbian安全性规则,你的应用程序不能含有比他更多的Capabilities:
LocalServices ,Location ,NetworkServices ,ReadDeviceData ,ReadUserData
SurroundingsDD ,SwEvent ,UserEnvironment ,WriteDeviceData ,WriteUserData
如何使用Accelerometers plug-in API开发应用程序。
首先下载:N95_RD_Accelerometer(http://research.nokia.com/files/N95_RD_Accelerometer.zip)
1,安装配置:
需要将N95AccelerometerPlugin.sis安装到你的手机(目前可以支持N95,N95 8GB,N93i,N82)
在开发环境中,将RDAccelerometer.h和RDAccelerometerObserver.h头文件放到SDK的\epoc32\include目录中,将*.dso和*.lib文件复制到SDK的\epoc32\release\armv5\LIB目录中
2,具体使用:
- 将库文件RDAccelerometer.lib添加到你应用程序的工程中
- 在你需要的类中继承MRDAccelerometerObserver接口,并实现HandleAccelerationL()函数接收来自加速度传感器的数据
- 创建一个CRDAccelerometer实例,并将上面提到的类作为参数传入
- 当实例创建完成后,加速度传感器数据会自动通过HandleAccelerationL()方法发送到应用程序中。
参数含义如下(参考RDAccelerometerObserver.h 获取更多信息):
- 1G加速度等于64
- 0G加速度等于0
- (-1G)加速度等于(-63)
- 删除CRDAccelerometer实例就可以停止接收来自传感器的数据
3,开发经验:
- 即使你将手机放在桌上不动,通过HandleAccelerationL()得到的数据还是略为有所改变。
- 每秒钟会有30帧的数据传入到HandleAccelerationL()中,非常耗电。
- 应用程序中尽量早地关闭传感器,在需要的时候再开启。
附上显示加速度传感器数据的例子TestSensorCode
Popularity: 26% [?]
01月 21st, 2008
Older Posts