Programming to enable automatic boot for s60 mobile phones

Source: Internet
Author: User
Programming to enable automatic boot for s60 mobile phones

You can set an alarm for the s60 cell phone clock. An alarm will be triggered automatically when the time is reached.

I tested it with "alarm server", so the idea is to write a "clock alarm" to "alarm server" by myself, which is equivalent to programming the alarm clock. The defect is that if the user chooses "no", there is no way.

The following code can be found:
Http://db.cs.helsinki.fi /~ Mraento/lxr/source/contextsensors/src/log_alarm.cpp

It has passed the test on the s60 SDK 2.1 simulator.

//. MMP
//...
Library ealwl. Lib

//. Cpp
# Include <t32alm. h> // For ralarmserver
//...
Ralarmserver ialarmserver; // forgive me
Tint err = ialarmserver. Connect ();
If (ERR = kerrnone)
{
Cleanupclosepushl (ialarmserver );
Talarminfo Info;
Talarmsetstate state;
Tint I, err =-1;

/* When this annotation is enabled, an alarm is set.
TTime t; // target time
Tfilename F; // sound file name
Ialarmserver. setclockalarm (0, T, F, F, ealarmclockonce );
*/
// The following code retrieves the preset alert clock.
Calarmidarray * IDs = new (eleave) calarmidarray (8 );
Cleanupstack: pushl (IDS );
Ialarmserver. alarmarraypopulatel (* IDS), ralarmserver: earraynext, 8 );
For (I = 0; I <IDS-> count (); I ++)
{
Tint id = IDS-> at (I );
Err = ialarmserver. alarminfo (Info, ralarmserver: einfobyid, ID );
If (ERR = kerrnone)
{// Query the clock alarm info
State = ialarmserver. alarmstate (info. ialarmid );
If (State! = Ealarmnotset & state! = Ealarmdisabled)
Break;
}
}
Cleanupstack: popanddestroy (); // IDS
Cleanupstack: popanddestroy (); // ialarmserver
}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.