I researched about how can I programmatically turn on/off wifi & 3G. For me it doesn't matter whether it is done by private API and even I had gone through Reachability Code but not able to accomplish the task.
Is there a way to do this?
Related
Is there a way to programmatically mute the sound on OSX without using private APIs and in a way that is accepted by the Mac App Store.
FOR MAC OS X: This tutorial might be of assistance.
FOR IOS: No.
Sound Mute is a system-wide setting. So for applications developed using the official SDK cannot change (and in most cases cannot even access) system-wide settings.
It is technically possible to change the system volume through the private AVSystemController class in Celestial.framework, but will prevent your app from getting Apple's approval.
On the Mac, see Srikar's answer. I believe he's got it covered.
On iOS, [MPMusicPlayerController iPodMusicPlayer].volume = 0.0 will mute the audio output. If there is an MPVolumeView present in your view hierarchy, it will do this without visual feedback; if there is not, it may present the volume change popup you see when you press the hardware volume buttons on the device.
I have an installation project in mind which involves a hacked iPad - I'd like to have a background process running recording all the touch events regardless of what app is running in the foreground, and send them out via OSC.
Note that this is using a jailbroken iPad with root access, and users will be alerted about not entering any sensitive data. But I'm not an iOS developer so I'm not sure if this is even possible. I'd appreciate any kind of input/suggestions.
[edit] Since someone questioned my motive behind this question, I'll try to explain a bit: to be specific, I'd like to build a mechanical system with Arduino that emulates the user's touch input on the iPad, but I do not want to limit them to using an app that does nothing else but recording touch events.
There are three options:
Use the IOHIDFamily subsystem to capture all the touch events. This will do most of the processing for you, the only thing you'll need to do is fetch the events using a HID client, get their types, and if they are touch events, get their position, radius and other things you need.
Use the MultitouchSupport framework. This way you will have to process the digitizer data frames manually which is tricky.
Use a MobileSubstrate hook to hook the already existing HID client inside SpringBoard.
My application need to know are external keyboard connect or no. How could i do to know that? No Private API please. :)
If this is iOS related, I'm not sure why you'd want to detect this as the hardware keyboard acts exactly the same as the software keyboard (except with a few extra shortcuts for sound, brightness etc. which your app shouldn't use anyway).
If you're considering screen space, then the software keyboard will still send it's notifications when it is displayed or when it is hidden, so you can respond to those. For example, say you have the software keyboard up and then you connect your external keyboard. The software keyboard will hide, and will post the UIKeyboardWillHideNotification. So you can respond to that.
I am having a mute button in my app,when an incoming call comes when I tap on to that button the incoming call's ringtone should become mute.
Can anyone suggest me how to do this programatically.
Thanks to all,
Monish.
Applications cannot alter core functionality of the device. As such, you cannot interfere with the phone capabilities. Therefore, what you are asking for is not possible.
I am, of course, assuming that you haven't jailbroken your phone.
how can I tell programatically if the bluetooth is turned on or of on the device?
And in ethier case turn it off or on programatically?
thanks
Are you talking about the popup that appears when you run the GKTank application while bluetooth is turned off? I suspect this is a function of the PeerPicker class - I haven't seen a way to query the bluetooth status directly.
However if you attempt to make a bluetooth call when bluetooth is off you'll receive a GKSessionCannotEnableError error code (Bluetooth is not currently available).
There's currently no way to interface with Bluetooth unless you join the Made for iPod / Works With iPhone program for some hardware you're developing.