Is there anything in the blackberry api or in j2me which would allow communications and/or pairing to a bluetooth device using the MAC address? (Assuming the device is not-discoverable)
Do you want to know how to generally connect to a device given the MAC address or are you interested in how to circumvent Blackberry specific security/permission issues? I have no idea for the latter case, but for the first case, here is an approach:
To do a service search on a remote device, you need an instance of the class javax.bluetooth.RemoteDevice, which you usually retrieve by a device search using a DiscoveryAgent. If you already have a device address you cannot create a RemoteDevice instance directly because the corresponding constructor of RemoteDevice is protected.
To circumvent this, you can create a new class extending RemoteDevice. In this derived class declare a public constructor which takes the device address. This public constructor is then able to call the protected super constructor:
public class MyRemoteDevice extends RemoteDevice {
public MyRemoteDevice(String addr) {
super(addr);
}
}
Now you have RemoteDevice for a specific device address without doing a device scan and without querying the known devices list.
Note: While this approach works according to my experience, it may still fail on a Blackberry device in case RIM implemented some hidden functionality in the RemoteDevice class which is ignored if a RemoteDevice instance gets created as shown here.
Related
Thank you for reading.
I'm trying to make a system that turns on the iPhone just by holding it over a certain machine.
To do that, I need to put a pass that supports express mode into the user's iPhone wallet.
It would be ideal to have a system like Japan's SuiCa where after registering an IC card in the iPhone, the ticket gate can be unlocked simply by holding the iPhone over the ticket gate.
There are many services that create passes, but all of them can only create barcode type or normal NFC type passes.
Even making a normal NFC type pass must go through Apple's strict examination and get approval, so I think it's more difficult to get approval for a pass that supports express mode.
Perhaps because of that, only global car manufacturers are able to create passes that support express mode.
Therefore, the service I want may not exist.
However, if you know of a service that can create a pass that supports express mode, please let me know.
Thank you very much.
I searched for a service that creates a pass compatible with the express mode of the wallet, but I couldn't find it.
I hope to find a service that will create a pass for the express mode of the wallet.
NFC Passes can do that to an extent. You will need to obtain an NFC Pass Type ID Certificate from Apple and use NFC reader with firmware that implements the Apple VAS protocol or create an app that uses iOS's NFCVASReaderSession class and configure it to poll for your NFC Pass Type ID, to be able to automatically wake the iPhone and select your NFC pass. Note that the Apple VAS protocol only polls for passes and makes them appear automatically. It is not possible to engage with the pass automatically like an Express pass, because the user still has to authenticate. But the experience is slicker than having to manually select a pass.
Android has an API method: getAllCellInfo() that "returns all observed cell information from all radios on the device including the primary and neighboring cells". On iOS, I've found the CTCarrier class to obtain information about the current user's home cellular service provider. I'm attempting to get all available external cell tower information from an iOS device.
Does iOS have a getAllCellInfo() equivalent?
UIDevice.current
Returns an object representing the current device.
You could maybe extend from UIDevice create your own method and return the stuff that you need, have a look at all the props here: https://developer.apple.com/documentation/uikit/uidevice
I found on the Apple website that:
Support is also provided for waking previously paired accessories that
do not automatically connect.
This would be useful for me, as the user does not need to do pairing every time before he launchs the app.
I referred to the EAAccessory Manager API, but there seems to be no such call to it.
Can anyone provide me more reference on this topic and how can I go about doing it?
This topic is explained at EAAccessoryManager Class Reference, on showBluetoothAccessoryPickerWithNameFilter:completion: that says that:
This method synchronously displays an alert containing the list of Bluetooth accessories that have been discovered by the current device and that match the specified filter (if any). The user can select an accessory from this list and pair the device to it. Pairing an accessory updates the accessory manager’s list of connected accessories and generates a corresponding connection notification.
Of course it's not enough to connect the external device successfully, because you have to do a few more steps before and after calling this method, like adding a protocol string of the external device on "Supported external accessory protocols" property of your project's plist etc, but it would be an answer to another question. Hope it helps.
So EAAccessory provides a property to retrieve the name of a device. From the devices I have queried, this usually is not the same as the friendly name you see in the Settings > Bluetooth page. It is usually a generic model name of the device.
Is there a way with an EAAccessory, or some other class to get the friendly name of the device?
I have very strange requirement. I have to generate notification (email) when user installs the application on the blackberry device. I have implemented Boolean and save that value in persistent storage with application version.
Also I have to generate the notification even if users deletes and installs the same app (same version) again. But I don't need to generate the notification if device reboots.
Note: Application is a service.
Salman
If you want the persistent store of an application to be deleted when the application is, then you need to use a Pesistable object that is defined in the application. in this case some thing like:
public class DetectMyApplicationInstallation extends Object implements Persistable {
public boolean installed;
public String version;
}
should do the trick. Enhance it to suit your needs.