×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 23

Thread: Alarm Clock

  1. #1
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Alarm Clock

    Hi,
    I am trying to create a Alarm Application that will play a .wav file when the alarm expire. I went through the link http://wiki.forum.nokia.com/index.ph...o_create_alarm and http://discussion.forum.nokia.com/fo...p?113704-Alarm!!.
    Could you please suggest me which one should i follow

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Alarm Clock

    Basically the wiki link is ok, the dibo link is ok as well, it clearly says that you can not change the audio file on any specific alarm.

    Instead, do have a look into the API plug-in, I'm rather sure it does have some repository keys for setting the device alarm clock as well as calender alarm sounds.

  3. #3
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Alarm Clock

    Quote Originally Posted by symbianyucca View Post
    Basically the wiki link is ok, the dibo link is ok as well, it clearly says that you can not change the audio file on any specific alarm.

    Instead, do have a look into the API plug-in, I'm rather sure it does have some repository keys for setting the device alarm clock as well as calender alarm sounds.
    are you talking about this http://wiki.forum.nokia.com/index.ph...k_Settings_API
    As its mentioned here http://wiki.forum.nokia.com/index.ph...es_are_ignored that we can't create our own alarm than is there anyway we could make rather differently, I mean can we change the device alarm settings from our application and replace the default alarm tone with our .wav file?
    Last edited by somnathbanik; 2010-11-30 at 10:03. Reason: added

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Alarm Clock

    Can you try it out ? it should work at least on some devices.

  5. #5
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Alarm Clock

    Quote Originally Posted by symbianyucca View Post
    Can you try it out ? it should work at least on some devices.
    You mean i can try to change the device alarm settings through my application and I can follow this link http://wiki.forum.nokia.com/index.ph...k_Settings_API
    do I need the Clock Settings API from 5th edition plugin, i downloaded but its not installing
    Last edited by somnathbanik; 2010-11-30 at 10:25. Reason: added

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Alarm Clock

    As you can see, it is Central repository, thus all SDKs do have central repository APIs, so all you need is the UID values for the repository as well as the index values. Do note that it might not work on older platforms, so you would need to test it to find out on which platforms it would really work on.

  7. #7
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Alarm Clock

    Quote Originally Posted by symbianyucca View Post
    As you can see, it is Central repository, thus all SDKs do have central repository APIs, so all you need is the UID values for the repository as well as the index values. Do note that it might not work on older platforms, so you would need to test it to find out on which platforms it would really work on.
    I am not clear with the Central repository. How do I get the UID value and the index value?
    I believe i need to go through this link http://wiki.forum.nokia.com/index.ph...k_Settings_API to get teh UID and the index value.
    Last edited by somnathbanik; 2010-11-30 at 11:00. Reason: added

  8. #8
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Alarm Clock

    Quote Originally Posted by symbianyucca View Post
    As you can see, it is Central repository, thus all SDKs do have central repository APIs, so all you need is the UID values for the repository as well as the index values. Do note that it might not work on older platforms, so you would need to test it to find out on which platforms it would really work on.
    Yes I am able to get the Clock Alarm Tone and the Alarm Snooze Time, even I can change the snooze time. Now how do I set the clock alarm tone and the time

  9. #9
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Alarm Clock

    Quote Originally Posted by symbianyucca View Post
    As you can see, it is Central repository, thus all SDKs do have central repository APIs, so all you need is the UID values for the repository as well as the index values. Do note that it might not work on older platforms, so you would need to test it to find out on which platforms it would really work on.
    Hi symbianyucca,
    I am able to replace the device alarm tone with my tone. Now how do I set the time and the weekdays flag.


    Please suggest me.

  10. #10
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Alarm Clock

    Hi Symbianyucca,
    I followed this link http://wiki.forum.nokia.com/index.ph...o_create_alarm to change the alarm clock time. but its different, this link plays the tone set for Calendar (even we change the clock alarm tone), every after the time interval.
    here is the code
    Code:
    case ECommand1:
    			{
    			
    			SetAlarmTime();
    			
    			
    			}
    			break;
    		case ECommand2:
    			{
    			//set sound file
    			iErrCode = iRepository->Get(KClockAppSoundFile, iDispVal);
    			if (iErrCode == KErrNone)
    				{
    				iRepository->Set(KClockAppSoundFile, KAlarmSound2);
    				}
    			else
    				{
    				iDispVal.Num(iErrCode);
    				iEikonEnv->AlertWin(_L("error"), iDispVal);
    				}
    			}
    			break;
    
    void CAlarmClockAppUi::SetAlarmTime()
    	{
    	iSession.Connect();
    	TASShdAlarm iAlarm;	//Alarm object
    	 
    	TTime ihomeTime;
    	ihomeTime.HomeTime(); // Get Current Hometime(local time set in mobile)
    	 
    	TInt  interval;
    	// interval – Give seconds after which alarm should expire
    	interval =61;
    	TTimeIntervalSeconds intervalSecs(interval); 
    	 
    	//Returns the time alarm is scheduled to expire
    	TTime& iNDT = iAlarm.NextDueTime(); 
    	 
    	//Set the NextDueTime in which alarm will expire
    	iNDT = ihomeTime + intervalSecs; 
    	 
    	TAlarmMessage& imessage(iAlarm.Message());
    	imessage.Copy(_L("Alarm")); //Alarm message
    	 
    	iSession.AlarmAdd(iAlarm);
    	iSession.Close();
    	}
    Is there any way i could change the Calendar Tone.
    Last edited by somnathbanik; 2010-11-30 at 12:25. Reason: added

  11. #11
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Alarm Clock

    I have used the #include <calendarinternalcrkeys.h> and this helps me to play my set song at a particular time, but I believe using the Calendar API i will not be able to play the alarm everyday at a particular time, it plays for once only. Isn't there any way I could change the clock alarm time not the calendar time?

  12. #12
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Alarm Clock

    Quote Originally Posted by symbianyucca View Post
    As you can see, it is Central repository, thus all SDKs do have central repository APIs, so all you need is the UID values for the repository as well as the index values. Do note that it might not work on older platforms, so you would need to test it to find out on which platforms it would really work on.
    I checked with this link http://wiki.forum.nokia.com/index.ph...o_create_alarm for settings time, it sets time and the alarm plays at a particular time, but its doesn't plays the same role as that of the clock alarm, i mean if I set the time and switch off the device the alarm doesn't starts automatically.
    So i believe I need to work with clock alarm api http://wiki.forum.nokia.com/index.ph...k_Settings_API not the calendar api http://wiki.forum.nokia.com/index.ph...o_create_alarm.
    Now, using the clock alarm api I can set my .wav file to Clock Alarm Tone, Now i just need to set the clock alarm time. Could you please suggest me how to do that?

  13. #13
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Alarm Clock

    if I use calendar alarm can I repeat the alarm. i have used the code like this
    TASShdAlarm iAlarm; //Alarm object
    iAlarm.iRepeatDefinition(EAlarmRepeatDefintionRepeatDaily );

    Is this a session alarm, cause I believe in session alarm we can't set the repeat definition, it will be only for once. I have followed this link http://wiki.forum.nokia.com/index.ph...o_create_alarm. please let me know whether its a session alarm or not.
    How can I repeat the alarm?

  14. #14
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Alarm Clock

    Quote Originally Posted by symbianyucca View Post
    Can you try it out ? it should work at least on some devices.
    Hi SymbianYucca,
    I have done some manupulation and now able to
    1. Set my own song to the alarm
    2. expire the alarm at a particular time
    3. Repeat the alarm every after 24 hrs.
    but the problem is
    1. The alarm can set a new time but doesn't clear the previous time.
    Eg. Let say now is 5:15PM and i set a alarm at 5:20PM. At 5:20 the alarm will play my song. Now let say at 5:30PM i set a new alarm time at 5:40PM. Now at 5:40PM today the alam will start again to play the song, and according to the logic the alarm should play the last time set for it, but this alarm will also play at 5:20PM tomorrow and then at 5:40Pm tomorrow. It should play at 5:40PM tomorrow only.


    Please suggest me how do I cancel the alarm while settings it for again.
    I used like this
    Code:
    TAlarmId iAlarmId;
    	iAlarmId = iAlarm.Id();
    	iSession.GetAlarmDetails(iAlarmId,iAlarm);
    	iAlarm.RepeatDefinition() = EAlarmRepeatDefintionRepeatDaily;
    but didn't work.

  15. #15
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,355

    Re: Alarm Clock

    My alarm can set a time and also can update the alarm time, but can't remove the previous time. It means if I call this function for twice it will set time for twice, and will start the alarm for twice. It should take the lasted time settings. here is the code below
    Code:
    void CAlarmClockAppUi::SetAlarmTime()
    	{
    	
    	iSession.Connect();
    TASShdAlarm iAlarm;	//Alarm object
    iAlarm.RepeatDefinition() = EAlarmRepeatDefintionRepeatDaily;
    TTime ihomeTime;
    	ihomeTime.HomeTime(); // Get Current Hometime(local time set in mobile)
    	 
    	TInt  interval;
    	// interval – Give seconds after which alarm should expire
    	interval =61;//86400 seconds of 24hrs
    	TTimeIntervalSeconds intervalSecs(interval); 
    	 
    	//Returns the time alarm is scheduled to expire
    	TTime& iNDT = iAlarm.NextDueTime(); 
    	 
    	//Set the NextDueTime in which alarm will expire
    	iNDT = ihomeTime + intervalSecs; 
    	 
    	TAlarmMessage& imessage(iAlarm.Message());
    	imessage.Copy(_L("Hungama Music Alarm")); //Alarm message
    			
    	
    	iSession.AlarmAdd(iAlarm);
    	iSession.Close();
    	CAknInformationNote *info = new (ELeave)CAknInformationNote();
    	info->ExecuteLD(_L("Setting Alarm..."));
    	}

    Anyone please suggest me.
    Last edited by somnathbanik; 2010-12-01 at 13:07. Reason: added

Similar Threads

  1. alarm clock problem
    By gougou0601 in forum Symbian
    Replies: 3
    Last Post: 2010-10-29, 03:58
  2. Clock application: alarm bugs (daylight saving time and deactivate/activate alarm)
    By SMGGM in forum Series 40 & S60 Platform Feedback Archive
    Replies: 1
    Last Post: 2009-10-26, 17:06
  3. J2ME alarm clock
    By Mazin in forum Mobile Java General
    Replies: 11
    Last Post: 2009-07-13, 11:03
  4. Alarm Clock
    By kelele in forum Mobile Java Tools & SDKs
    Replies: 8
    Last Post: 2007-02-07, 12:24
  5. clock alarm
    By jack44 in forum Symbian
    Replies: 1
    Last Post: 2003-02-07, 18:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×