views:

359

answers:

1

Hi, I'm developing a Blackberry application, where I need to get the list of profiles from phone (for sound settings).

Is there any way for getting the profile info?

+3  A: 

There is no way to query the selected profile, but you can integrate into the profiles so that the user can select the notification they want from your application in each profile. Please see the notificationsdemo included with the BlackBerry JDE for an example.
Mark Sohm
BlackBerry Development Advisor
www.BlackBerryDeveloper.com

BlackBerry Support Community Forums:Java Development:Profiles support in API

As far as I know, there are two things you can do with Profiles from app

Register Notification Source

 // NotificationEvent converted to long
 public static final long ID = 0x3965ce1e5d258a10L;
 public static final Object event = new Object() {
  public String toString() {
   return "Notification Event";
  }
 };

 private void registerNotificationSource() {
  NotificationsManager.registerSource(ID, event,
    NotificationsConstants.CASUAL);
 }

 private void deregisterNotificationSource() {
  NotificationsManager.deregisterSource(ID);
 }

Open Profiles App

 private void openProfiles() {
  int handle = CodeModuleManager
    .getModuleHandle("net_rim_bb_profiles_app");
  ApplicationDescriptor[] appDescr = CodeModuleManager
    .getApplicationDescriptors(handle);
  if (appDescr.length > 0) {
   try {
    ApplicationManager.getApplicationManager().runApplication(
      appDescr[0]);
   } catch (ApplicationManagerException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
  }
 }
Max Gontar