check for blackberry simulator in code

453 Views Asked by At

Is there any way to detect in java code whether or not the code is running on a blackberry simulator or on a real device? I have to set a connection string based on whether its running on the simulator or on the real device and would like to set that automatically...

1

There are 1 best solutions below

0
On BEST ANSWER

Call DeviceInfo.isSimulator(), this is found in net.rim.device.api.system. See http://www.blackberry.com/developers/docs/4.0.2api/net/rim/device/api/system/DeviceInfo.html for the class details.