Ben
Ben

Reputation: 16534

check for blackberry simulator in code

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...

Upvotes: 2

Views: 443

Answers (1)

DaveTrux
DaveTrux

Reputation: 475

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.

Upvotes: 6

Related Questions