Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 70
Registered: ‎04-20-2012
My Device: BB 9105
My Carrier: Vodafone
Accepted Solution

System Time change notification - BB 10

Hi,

 

Is there any event/signal which is emitted when user tries to change the time (or timezone) on the device. On older Blackberry 5/6/7 version, I used to get DateTimeUtilities.GUID_TIMEZONE_CHANGED and DateTimeUtilities.GUID_DATE_CHANGED.

 

Thanks

Brsengar

Developer
Posts: 70
Registered: ‎04-20-2012
My Device: BB 9105
My Carrier: Vodafone

Re: System Time change notification - BB 10

I looked into Native SDK library function and found the solution. I hope it could be useful for someone else.

 

You need to use BPS library in your Cascades, and subsribe to clock_get_domain() and then register for clock_request_events(0) : Note 0 is default value and other values are kept for future references.

 

You have to look for clock_get_domain() event in bps events loop and whenever date/time/timezone is changed, you will get your event as:

 

if (dcode == clock_get_domain()) {
unsigned int code = bps_event_get_code(event);
if(code == CLOCK_INFO) {
int seconds = clock_event_get_date_change(event);
const char* timezone = clock_event_get_time_zone_change(event);
}

 

 

 

 

Developer
Posts: 70
Registered: ‎04-20-2012
My Device: BB 9105
My Carrier: Vodafone

Re: System Time change notification - BB 10

I looked into Native SDK library function and found the solution. I hope it could be useful for someone else.

 

You need to use BPS library in your Cascades, and subsribe to clock_get_domain() and then register for clock_request_events(0) : Note 0 is default value and other values are kept for future references.

 

You have to look for clock_get_domain() event in bps events loop and whenever date/time/timezone is changed, you will get your event as:

 

unsigned int dcode = bps_event_get_domain(event);

if (dcode == clock_get_domain()) {
     unsigned int code = bps_event_get_code(event);
      if(code == CLOCK_INFO) {
             int seconds = clock_event_get_date_change(event);
            const char* timezone = clock_event_get_time_zone_change(event);
       }

}

 

Hope it helps.