Is it possible to turn off Blackberry Device programmatically ?
Perhaps you could use requestPowerOff() method in the Device class.
As far as I know there is no "clear" solution for that. Take a look on this thread: http://supportforums.blackberry.com/t5/Java-Development/Turn-on-off-Bluetooth-programmatically/td-p/489615
But you can use key injection to turn device off. It works quickly enough, so from the user perspective that device is just switched off.
Related
We can set up a focus status with customized turning on time and turning off time. I'd like to be notified when I am in my own app. Unfortunately INShareFocusStatusIntentHandling was not called when a system notification "Focus on" came out. Anybody know some solutions or ideas about it. Thanks ahead!
According to https://developer.apple.com/forums/thread/682143 you need to implement an Intents Extension from your app and have that extension share the results to the main app via UserDefaults or some other method. You cannot observe the focus state changes directly in your app.
I was wondering if there's anyway to modify how the iPhone takes pictures. Specifically, if you can turn off the dimmer focus flash that shows up before the full flash, so when you take a picture it's just the full flashlight that comes on immediately. Thanks!
Unfortunately, no, I think not. From the apple developer site:
Flash Modes
There are three flash modes:
AVCaptureFlashModeOff: The flash will never fire.
AVCaptureFlashModeOn: The flash will always fire.
AVCaptureFlashModeAuto: The flash will fire dependent on the ambient
light conditions. You use hasFlash to determine whether a device has a
flash. If that method returns YES, you then use the
isFlashModeSupported: method, passing the desired mode to determine
whether a device supports a given flash mode, then set the mode using
the flashMode property.
And there is no mention of the dimmer flash.
EDIT: Maybe you can. There are lots of iOS apps that do this
2nd Edit: After looking at this, I have concluded that you cannot do so.
I am making a VoIP application for iOS. For incoming calls, I have set some custom ringtones. It's working fine, but I want to check whether the device settings are set to Vibration mode or not programmatically.
I have searched on the web regarding this issue, but I've only found answers for silent mode detection. Instead, I want to check whether the device is in vibration mode or not.
When an incoming call comes to my app, I want to use vibration mode if the device settings are set to vibration mode.
Could any one help me?
At first look it seems like none of the Audio Session properties allow you to read the value of this setting. However an alternative, albeit not exactly what you're looking for, is to check if the ringer is set to on-or-off and provide at least a semi-expected vibration experience to your user.
Ronak Chaniyara pointed you to the right answer here, however that is deprecated in iOS 7.0. Instead use AVAudiSession -setCategory to set the proper category of your audio. If you expect your audio to be muted by the silent switch or screen lock use AVAudioSessionCategorySoloAmbient otherwise use AVAudioSessionCategoryPlayback.
More details on AVAudioSession, it's settings and properties can be found here.
can you trigger airplay mirroring with iOS 5 code?
I see in the API how you can stream. Just wonder if anyone knows how to turn on and off mirroring programmically in my app on iPad2 using iOS5, or if that even is possible.
I DO see how to physically turn it on via the dock at the bottom of the screen,
so no need to post a link to the Apple demo of that.
Thanks in advance
It's currently not possible. With a bit of luck this may change tomorrow, but it isn't something I can see apple doing. (for the same reasons as they dont allow toggling bluetooth/airplane mode/wifi etc..)
I was wondering if there was a specific method called when we press the 2 buttons of the iPhone (using Home-Button & Power on/off) to take a screenshot. If yes, I would known his name to use her in programming.
There used to be a UIGetScreenImage() function that you could use to capture the screen. Apple no longer allows use of that function in App Store apps, so you have a few other options. CALayer has a -renderInContext: method—Google it—that you can use to copy a view’s contents to a graphics context; this does not, however, work for OpenGL content, video, or live imagery from a device’s camera. I’m not sure about solutions for the first two, but for the latter—getting images from the camera—you’ll need to use the AVFoundation framework.
It is a system level service for which the app never receives any notification or method call.
I believe that would be a native method, not accessible from the IPhone SDK. In what context are you going to be using this? You might be looking for this - Take screenshot from code