黑莓 - 获取配置文件列表和积极的信息档案 [英] Blackberry - Get list of Profiles and active Profile info
问题描述
我正在开发黑莓应用程序,其中我需要的配置文件从手机(声音设置)列表。
有没有办法获取的个人资料信息?
有没有办法查询所选配置文件,但可以集成到配置文件,以便用户可以选择他们从每个配置文件应用程序所需的通知。请参阅附带的BlackBerry JDE一个例子notificationsdemo。结果
马克·佐姆结果
黑莓开发顾问结果
www.BlackBerryDeveloper.com
块引用>据我所知,有两件事你可以使用配置文件执行从应用程序
注册通知源
// NotificationEvent转换为长
公共静态最后长ID = 0x3965ce1e5d258a10L;
公共静态最终目标事件=新的对象(){
公共字符串的toString(){
返回通知事件;
}
}; 私人无效registerNotificationSource(){
NotificationsManager.registerSource(ID,事件,
NotificationsConstants.CASUAL);
} 私人无效deregisterNotificationSource(){
NotificationsManager.deregisterSource(ID);
}打开配置文件应用程序
私人无效openProfiles(){
INT处理= codeModuleManager
.getModuleHandle(net_rim_bb_profiles_app);
ApplicationDescriptor [] = appDescr codeModuleManager
.getApplicationDescriptors(手柄);
如果(appDescr.length大于0){
尝试{
ApplicationManager.getApplicationManager()。runApplication(
appDescr [0]);
}赶上(ApplicationManagerException E){
// TODO自动生成catch块
e.printStackTrace();
}
}
}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?
解决方案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.comBlackBerry 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(); } } }
这篇关于黑莓 - 获取配置文件列表和积极的信息档案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!