Retrieving the public connections setting for your application

The net.rim.blackberry.api.bbm.platform.SettingsManager class provides a constant, SETTING_ALWAYS_ALLOW_PUBLIC_CONN, that allows your app to determine whether a user has chosen to be prompted before they make or join a public connection.

To retrieve this setting, you must first obtain your application's SettingsManager object by invoking getSettingsManager() on your application's BBMPlatformContext object.

To determine the status of the public connections setting, invoke SettingsManager.getSetting() and specify SETTING_ALWAYS_ALLOW_PUBLIC_CONN as the field to return.

int value = SettingsManager.getSetting(SettingsManager.SETTING_ALWAYS_ALLOW_PUBLIC_CONN);

if(value == SettingsManager.VALUE_ENABLED)
    // User will not be prompted
else if(value == SettingsManager.VALUE_PROMPT)
    // User will be prompted

Was this information helpful? Send us your comments.