【问题标题】:Blackberry - Get list of Profiles and active Profile infoBlackberry - 获取配置文件列表和活动配置文件信息
【发布时间】:2010-12-25 22:36:01
【问题描述】:

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

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

【问题讨论】:

    标签: blackberry operating-system integration notifications


    【解决方案1】:

    无法查询所选配置文件,但您可以集成到配置文件中,以便用户可以在每个配置文件中从您的应用程序中选择他们想要的通知。有关示例,请参阅 BlackBerry JDE 随附的通知演示。
    马克·索姆
    黑莓开发顾问
    www.BlackBerryDeveloper.com

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

    据我所知,您可以使用应用程序中的个人资料做两件事

    注册通知源

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-04-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多