Retrieve a BlackBerry device object
To search for a specific
BlackBerry®
device, you can use the user account assigned to the
BlackBerry
device.
Before you begin: Retrieve the
userID integer for the ID of the user account assigned to the
BlackBerry
device.
-
Invoke findDeviceForUser().
FindDeviceForUserResult result=coreWebService.findDeviceForUser(userID, locale, true);
-
Check the result for errors and handle any errors.
if (result.getFindDeviceForUserReturnStatus().getCode()!= FindDeviceForUserReturnStatusEnumType.SUCCESS)
{
// handle any errors
}
-
Verify that there is a BlackBerry device assigned to the the user account.
if (result.getDevice() == null)
{
// notify the user
}
- Return the BlackBerry
device object.
Device device = result.getDevice();
return device;
Was this information helpful? Send us your comments.