Posts filed under 'Symbian开发技巧'
做一个GUI程序,界面就一个SettingList够了。把用户的配置信息保存到文件里。
本来想写个ini文件,但是后来发现,在ECom的DLL里面读写有问题:因为ini文件需要在Application里面重载一个函数,但是ECom的DLL中根本就没有Application。
接着的想法是直接用ReadStream,WriteStream写一个二进制文件,把配置的数据保存在二进制文件中,然后再在ECom的DLL中读出来。
文件的位置放在哪儿呢?
因为GUI和ECom的DLL是两个不同程序,所以也就不能放在private\E3B08845这种目录下面。
因为GUI能读到的话,EComDLL就读不到,反之亦然。
ps,hongkong nokia开发的那个程序好像可以放到那种目录下面的,不知道是如何实现的,有空研究一下!
最后还是最简单的方法实现吧,放到C:\data目录下总没有什么问题吧,赫赫。
Popularity: 5% [?]
09月 23rd, 2007
基本思路:
首先程序运行时注册按键事件,然后将程序转入后台运行,当按键事件发生后在AppUi的HandleKeyEventL中处理。
相关代码如下:
void CClockSSAppUi::SetCaptureKey()
{
// If there is another handle, we have to cancel it first.
CancelCaptureKey();
// This will capture scan code of the keypress.
iHandleCaptureKey = CCoeEnv::Static()-> RootWin().CaptureKeyUpAndDowns(
KOkKeyScanCode, EModifierShift, EModifierShift PRIORITYCAPTUREKEY);
//// WARNING: We need to capture the normal code of keypress otherwise
// the key event will be sent to another application.
iHandleCaptureKey2 = CCoeEnv::Static()-> RootWin().CaptureKey(
KOkKeyCode, EModifierShift, EModifierShift PRIORITYCAPTUREKEY);
}
TKeyResponse CClockSSAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
{
if ((KOkKeyScanCode == (TUint) aKeyEvent.iScanCode) && (EEventKeyDown == aType)
&& ((aKeyEvent.iModifiers & EModifierShift) == EModifierShift) )
{
CAknGlobalNote* globalNote = CAknGlobalNote::NewLC();
globalNote->ShowNoteL(EAknGlobalInformationNote, _L(”Captured KEY!”));
CleanupStack::PopAndDestroy();
}
}
需要注意的是:如果你的是多view程序,并且调用了AppUi::AddToStackL接收按键事件,那么在这些控件OfferKeyEventL的处理中对于不相关的键事件一定要返回EKeyWasNotConsumed,好让AppUi最后能处理。
因为这个问题,研究了近3个小时,sigh。。。
Popularity: 7% [?]
09月 22nd, 2007
The app failed during signing because of the following reason:
Unallocated UID/SID: 6ef7f58. Check that all the UIDs used in your SIS
(including the UID used in your .pkg) file correspond to those allocated to
you by Symbian from www.symbiansigned.com.
看来还是会sign的,要好好看看test criteria,提交一个比较好的版本!
Popularity: 4% [?]
09月 21st, 2007
比如说,当按下back后,在HandleCommandL()中加入如下处理:
case EAknSoftkeyBack:
{
TApaTask apaTask(iEikonEnv->WsSession());
apaTask.SetWgId(CCoeEnv::Static()->RootWin().Identifier());
apaTask.SendToBackground();
break;
}
解释一下:
A task is a running application.
A task is identified by its association with the running application’s window group.
apaTask把自己送到后台,并在后台继续运行。
Popularity: 6% [?]
09月 20th, 2007
试验一下,我这个东西实在太简单了,不知道会不会被接受?!
具体方法如下:
1,到www.symbiansigned.com 网站,输入自己的帐号。
2,进入“My Symbian Signed”标签页,并选择左边的“Applications->Submit Freeware”。
3,一共有六步,基本上都是同意一些协议。第三步下载一个sample.zip文件,这里面就是你要提交的模版,主要有:一个sis,一个pkg,还有一个readme。
4,需要在自己提交的sis里面加上一个FreewareWarningEN.txt文件。
具体做法:把文件放在pkg目录下,然后在pkg中加上下面一句话:
“.\FreewareWarningEN.txt”-”",FT
具体内容可以如下:
This application is freeware and may not be sold. If you believe you have paid for this application, please e-mail symbiansigned@symbian.com with the details of where you obtained the product.
5,最后按照上述要求将自己的要提交的东西打包成zip上传即可。
Popularity: 3% [?]
09月 19th, 2007
用SISXplorer,这款软件非常不错。再也不用复杂的命令行操作了!
可以查看到很多信息,还可以将sis文件解压出来。
需要安装.net framework 2.0。

Popularity: 3% [?]
09月 19th, 2007
网上下载的软件已经过期了,怎么办?
1,首先移除它的证书:
signsis -u sisname.sisx sisname.sis
2,用自己的dev证书sign:
signsis sisname.sis sisname.sisx mycer.cer mykey.key mypassword
Popularity: 3% [?]
09月 18th, 2007
Newer Posts