How to get name of paired MFI device to iPhone via bluetooth? - iphone

I have a MFi keyboard. It is already paired to the iPhone via bluetooth.
I want to programmatically get the name of the paired keyboard. I searched some forums and they say it's possible to do that...
But how do we get the name using "External Accessory"?
A sample code would help me a lot.
Thanks

Initialize your EAAccessory object and then call the property name on your accessory object
NSLog(#"%#",connectedAccessory.name);

Related

External Device reports no Protocol

I have an app that I have been working on and I am now at the point that I want to integrate some interaction with an external device via the dock connector. The device that I am using (the iDive 300) conforms to the Made For iPod program. I have written a separate simple app based on the EADemo code to gather information about the device. However, when I run this app the iDive reports nothing for the Name, Serial Number, Firmware, etc and also says that no protocols were found. I know this simple app is working correctly because I have connected to several other external devices and the Name, serial number, etc is populated for each device.
The other odd thing is that the iDive seems to work properly when plugged into my iPhone 4 (i.e. it will increase the volume and play songs and videos found on my iPhone via the buttons on the device). Shouldn't this mean that some protocol is in place for this device to communicate with the iPhone? Is it all possible for me to read data from this device (e.g. capture when the 'play','menu', or other buttons are pressed) if I don't know the protocol?
I am completely new to the External Accessories framework and any help is appreciated!
You should autopsy the app that is associated with iDive. In its info.plist, there should be a key:
UISupportedExternalAccessoryProtocols
whose value is an array(See this for the formal definition), and within it lies a string whose value looks like a reversed domain name, as the device protocol.
You should edit your Info.plist, add the key('Supported external accessory protocols' in plain English) for an array, put in the protocol as its item.
There's no guarantee that an accessory actually uses EA. It may communicate using the protocols defined by Apple.
EA is only necessary if you want to communicate using your own proprietary protocol.
Check the EADemo example from Apple... If it doesn't show up in the demo app, it's not EA.

Are there iOS API calls to get access to the UMTS pdp interface on the iPhone?

I want to get some infos about the cellular network the UMTS interface on my iphone is connected to. Does anyone know API calls, that do this job. I remember an app on android os, where it was possible to get such info. I'm doing some Objective-C programming and was wondering if that'd be possible or if Apple does not support that.
Eventually I want to get something like this on the iphone, which is a super cool app!
http://www.panix.com/~mpoly/android/antennas/r1.0/
I don't think there is a public api for this.
The only think that you can read is
allowsVOIP property
carrierName property
isoCountryCode property
mobileCountryCode property
mobileNetworkCode property
From CTCarrier Class Reference
Take a look to the Core Telephony Framework Reference

Print doc with iPhone application

I am a new iPhone Application developer. I want to create an application which will print a document or string by a button tap.After tapping the button search the printer which is in network path.iPhone device and printer will be connected with wireless LAN. I read the Apple guideline to create such type of application, but I am so new a developer that I don't understand all of this.
Thanks in advance.
You might find this tutorial http://bynomial.com/blog/?p=115 helpful.

How to identify when SIM changed in iPhone?

How to find if a user changes his SIM card from his phone(iPhone). we can find "mobileCountryCode,isoCountryCode,mobileCountryCode and mobileNetworkCode" through programatically these are not specific to particular SIM, these are specific to operator, is there any way to identify when user changes his SIM card from his iPhone.
Please any one help me on this.
Thanks in advance.
You are able to sign up for a notification using subscriberCellularProviderDidUpdateNotifier in
CTTelephonyNetworkInfo
However you will only be notified if the swap occurs while your app is running. You will still be unable to detect if the user changes the SIM to another SIM from the same operator when your app is not running.
Hi tony You can use this for finding sim has been changed or not.
NSString *currentIMSINo = CTSIMSupportCopyMobileSubscriberIdentity(NULL);

geo location and blocking access to my app on iPhone

I am working on a radio player for iPhone.
What I need is to provide my position before playing stream.
I am thinking of using CoreLocation, it's ok, but how to determine geo position if user does not allow CoreLocation when asked ?
What would be the best way to determine the position of the iPhone?
I was thinking of getting IP address, but it could be an address from another country. For exemple, user has an iPhone account in United States, and is using my application in 3G in Canada, IP address will be provided by his cell carrier right ?
So I was wondering how to get cell carrier name, without success... using a private framework is not possible.
I am waiting for your great suggestions!
thierry
I would just use core location. If for whatever reason the user declines the core location popup, then just prompt them to enter their location manually (e.g. choose country and city).
You could use the IP address, but then you run into other problems as well (for instance if they are using WiFi on their iPhone or are on an iPod touch.
I think this is not allowed, and by design. If the user doesn't want your app to know where they are, why do you think you have the right to ignore their wishes?