Blackberry - Get list of Profiles and active Profi

2019-08-11 10:46发布

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?

1条回答
叼着烟拽天下
2楼-- · 2019-08-11 10:52

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();
   }
  }
 }
查看更多
登录 后发表回答