IPAD must-haves. And fun-to-haves.

Brighten your iPad with a colorful cover, stream to your TV, download pictures from your digital camera, and more. There’s already so much you can do with iPad and iPad mini

Apple Wireless Keyboard

The incredibly thin Apple Wireless Keyboard uses Bluetooth technology, which makes it compatible with iPad

Apple unveils iPad mini: ‘Thin as a pencil, light as paper’

iPad inspires creativity and hands-on learning with features you won’t find in any other educational tool

Lightning connector and FaceTime HD camera

Apple announces 4th generation iPad packing an A6X CPU

Pages

Showing posts with label sleep. Show all posts
Showing posts with label sleep. Show all posts

Thursday, January 17, 2013

Is there a way to detect the event when device goes to sleep and the screen blackens?

I want to detect the event when the iOS device goes to sleep and the screen blackens?

Is there any way to do it?


View the original article here

Is there a way to detect the event when device goes to sleep and the screen blackens?

I want to detect the event when the iOS device goes to sleep and the screen blackens?

Is there any way to do it?


View the original article here

Thursday, January 10, 2013

Re: Is there a way to check if the iOS device is in sleep mode?

I want to detect the lock/unlock events in the device, so far I got the darwin notifications as given below,:

 

-(void)registerForDarwinNotif

{

 

 

   

 

    //Screen lock notifications

    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), //center

                                    NULL, // observer

                                    displayStatusChanged, // callback

                                    CFSTR("com.apple.iokit.hid.displayStatus"), // event name

                                    NULL, // object

                                    CFNotificationSuspensionBehaviorDeliverImmediately);

   

   

    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), //center

                                    NULL, // observer

                                    displayStatusChanged, // callback

                                    CFSTR("com.apple.springboard.lockstate"), // event name

                                    NULL, // object

                                    CFNotificationSuspensionBehaviorDeliverImmediately);

   

    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), //center

                                    NULL, // observer

                                    displayStatusChanged, // callback

                                    CFSTR("com.apple.springboard.hasBlankedScreen"), // event name

                                    NULL, // object

                                    CFNotificationSuspensionBehaviorDeliverImmediately);

   

 

   

   

}  

 

//My call back

static void displayStatusChanged(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)

{

       NSLog(@"IN Display status changed");

    // you might try inspecting the `userInfo` dictionary, to see

    //  if it contains any useful info

  

        NSLog(@"Darwin notification NAME = %@",name);

   

   

   

}

   

 

I am able to get the darwin notifications when device is locked/unlocked, but the real problem is how identify between if the notification has come from locking or the unlocking of the device. Console logs are:

 

Jan 10 11:29:01 Frost-bank LockDetectDemo[2086] : IN Display status changed

Jan 10 11:29:01 Frost-bank LockDetectDemo[2086] : Darwin notification NAME = com.apple.springboard.lockcomplete

Jan 10 11:29:01 Frost-bank LockDetectDemo[2086] : IN Display status changed

Jan 10 11:29:01 Frost-bank LockDetectDemo[2086] : Darwin notification NAME = com.apple.springboard.lockstate

Jan 10 11:29:01 Frost-bank LockDetectDemo[2086] : IN Display status changed

Jan 10 11:29:01 Frost-bank LockDetectDemo[2086] : Darwin notification NAME = com.apple.springboard.hasBlankedScreen

Jan 10 11:29:01 Frost-bank LockDetectDemo[2086] : IN Display status changed

Jan 10 11:29:01 Frost-bank LockDetectDemo[2086] : Darwin notification NAME = com.apple.iokit.hid.displayStatus


View the original article here

Wednesday, January 9, 2013

Is there a way to check if the iOS device is in sleep mode?

Hi All,

 

I have used GPS location updates in my application. I want to detect if the iOS device is in sleep mode so that I can turn off the GPS and optimize the battery use. I have already tried pausesLocationupdates in iOS 6, but it does not work as desired.

I want to turn off the GPS as soon as the device goes to sleep mode. Is there any way to achieve this functionality ?

 

Thanks in advance.


View the original article here

Is there a way to check if the iOS device is in sleep mode?

Hi All,

 

I have used GPS location updates in my application. I want to detect if the iOS device is in sleep mode so that I can turn off the GPS and optimize the battery use. I have already tried pausesLocationupdates in iOS 6, but it does not work as desired.

I want to turn off the GPS as soon as the device goes to sleep mode. Is there any way to achieve this functionality ?

 

Thanks in advance.


View the original article here

Re: Is there a way to check if the iOS device is in sleep mode?