Blackberry - 获取个人资料列表和活动个人资料信息

时间:2009-12-12 06:38:03

标签: blackberry operating-system integration notifications

我正在开发一个Blackberry应用程序,我需要从手机中获取配置文件列表(用于声音设置)。

有没有办法获取个人资料信息?

1 个答案:

答案 0 :(得分:5)

  

无法查询所选的配置文件,但您可以集成到配置文件中,以便用户可以在每个配置文件中从应用程序中选择所需的通知。有关示例,请参阅BlackBerry JDE附带的notificationsdemo   马克苏姆   BlackBerry Development Advisor
  www.BlackBerryDeveloper.com

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

据我所知,您可以通过app

使用个人资料做两件事

注册通知来源

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

打开个人资料应用

 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();
   }
  }
 }
相关问题