当前位置:编程学习 > wap >>

s60里的关机闹钟程序是怎么做的,了解的大致说一下,市面上好像没有可以关机闹钟的程序

RT --------------------编程问答-------------------- CTimer::After()
可以在关机的情况下开机并运行
你可以在重载的runL里面放个铃声就可以了 --------------------编程问答-------------------- To 楼主:

我很早之前写过一个设置闹钟的测试代码:
http://topic.csdn.net/t/20051209/17/4449514.html

To windcao: 

请问你是在哪台S60手机上做的测试?我印象中没有S60手机/Symbian手机支持你所说的那个特性。
--------------------编程问答-------------------- 抱歉我搞错了 是CTimer::At()

At()
void At(const TTime& aTime);
Description
Requests an event at a given time.

The "at timer" completes at the specified time — if the machine is in a turned off state at that time, the machine will be turned on again.

Notes:

The CTimer’s RunL() function will be run as soon as possible after the specified time.

The RunL() may be delayed because the RunL() of another active object, with the deepest nesting-level active scheduler on the same thread, is running when the event occurs: this cannot be avoided, but can be minimised by making all RunL()s of short duration.

The RunL() may be delayed because other, higher-priority, active objects are scheduled instead. This can be avoided by making CTimers very high-priority.

The TTime object should be set to the home time. See TTime::HomeTime()

Parameters
const TTime& aTime The time at which the event is to occur.
 
 
--------------------编程问答-------------------- if the machine is in a turned off state at that time, the machine will be turned on again.
呵呵,子腾兄的方法属于高级方法,可以用在 5.0以前的 版本。
对于5.0以后的 版本可以用CTimer::AT()方便多了 --------------------编程问答-------------------- To windcao: 

请问你是在哪台S60手机上做的测试?我印象中没有S60手机/Symbian手机支持你所说的那个特性。

--------------------编程问答-------------------- 做个标记,很有用 --------------------编程问答-------------------- mark --------------------编程问答-------------------- Mark --------------------编程问答-------------------- 有什么方法可以得到系统关机事件吗?
或者类似的电池电量的状态是怎么得到的? --------------------编程问答-------------------- 据帮助说,CTimer::At()是可以在手机关机情况下响应的,不过没做过测试。
帮助里是这样说的:
The "at timer" completes at the specified time — if the machine is in a turned off state at that time, the machine will be turned on again. --------------------编程问答-------------------- 据我所知,以上这段内容沿用自“古老的”EPOC操作系统的SDK帮助文档:

At() — creates an "at timer", which completes at the specified time; if the machine is off at that time, the machine will be turned on again.

实际上这里的"off"指的是EPOC机器处于待机状态,而非关机状态。
--------------------编程问答-------------------- after是不行的,比如你设置5000,after的时候关机了,只有下次开机才会执行剩下的。
用at就比较不错了。 --------------------编程问答-------------------- 噢,楼上的也来趟浑水,我还是要质疑:

请问你是在哪台S60手机上做的测试?我印象中没有S60手机/Symbian手机支持你所说的那个特性。

补充:移动开发 ,  Symbian
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,