Posts filed under 'Symbian开发技巧'

small font problem for the setting list

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…

font bad    font good

Popularity: 14% [?]

Add comment 06月 25th, 2008

How to hide app icon from the main menu

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: 15% [?]

1 comment 06月 15th, 2008

How to Invoke the browser from your app

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: 15% [?]

Add comment 06月 14th, 2008

About Viewsrv 11 panic

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: 25% [?]

Add comment 04月 23rd, 2008

Tips for Symbian Express Signed!

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: 32% [?]

2 comments 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安装过程中就会显示:
screenshot0001.jpg

Popularity: 28% [?]

Add comment 03月 13th, 2008

State Machine of phone calls

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: 25% [?]

Add comment 03月 10th, 2008

如何使用加速度传感器(Sensor)API

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: 38% [?]

6 comments 01月 21st, 2008

如何通过程序设定是否开机自启动

主要有两个步骤:
1,使用Startup List Management API实现开机自启动
2,重载AppUI中的ProcessCommandParametersL()函数确定是否关闭(自启动后关闭==不启动)

1.1 在data目录下创建一个boot resource file,名字为XXXX.rss, 其中XXXX为UID3。
#include <startupitem.rh>
RESOURCE STARTUP_ITEM_INFO startexe
{
    executable_name = \\sys\\bin\\programToStart.exe; //换成你程序名字
    recovery = EStartupItemExPolicyNone;
}
1.2更新你的MMP文件
SOURCEPATH      ..\data
START RESOURCE XXXX.rss
END
1.3更新你的PKG文件,中括号不要丢了!
“\epoc32\data\yyyy.rsc”- “c:\private\101f875a\import\[yyyy].rsc”
有以下几点限制:必须装在c盘,必须用开发者证书。

 如果一切顺利,程序可以自己随着手机开机而自己启动了,但是如何让用户可以在程序中设置让程序不要随机启动呢?
2.1修改程序的注册文件YourAppName_reg.rss:
#include <appinfo.rh>
#include <uikon.rh>   
RESOURCE APP_REGISTRATION_INFO
{
//其他原有代码
  opaque_data = r_startup_detect;
}      
RESOURCE NUMBER_INT8 r_startup_detect
{value = 1;}
2.2 重载AppUI中的ProcessCommandParametersL()函数
Bool CMyAppUi::ProcessCommandParametersL( CApaCommandLine &aCommandLine )
{
  if(aCommandLine.OpaqueData().Length() > 0)
  {
      // 用户手动启动,存在OpaqueData
  }
  else
  {
      // 程序自动启动,存在OpaqueData。
      // 可以在这里判断是否设置为不自动启动, 调用Exit()函数退出
  }
   return CEikAppUi::ProcessCommandParametersL( aCommandLine );
}

 

Popularity: 23% [?]

Add comment 01月 4th, 2008

按下红色结束通话键,程序仍然运行

在Symbian S60第三版中,按下红色的结束通话键,程序默认退出,当还想保持程序继续运行状态,可以在AppUi的HandleWsEventL函数中进行处理,以下代码来自ScreenShot。
// ————————————————————————–
// Starting from S60 3.x, pressing End key will terminate application.
// We don’t want this to happen in this application, so we have to handle
// End key event (KAknUidValueEndKeyCloseEvent).
// ————————————————————————–
void CXXXAppUi::HandleWsEventL(const TWsEvent &aEvent, CCoeControl *aDestination)
    {
    switch (aEvent.Type())
        {
        case KAknUidValueEndKeyCloseEvent:
            break;

        default:
            CAknAppUi::HandleWsEventL(aEvent, aDestination);
        }
    }

Popularity: 21% [?]

Add comment 01月 3rd, 2008

Older Posts


标签

Calendar

08月 2008
« Jul    
 123
45678910
11121314151617
18192021222324
25262728293031

Posts by Month

Posts by Category