Blackberry - Get list of Profiles and active Profile info

℡╲_俬逩灬. 提交于 2019-12-13 02:05:47

问题


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:


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();
   }
  }
 }


来源:https://stackoverflow.com/questions/1892579/blackberry-get-list-of-profiles-and-active-profile-info

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!