我正在开发一个Blackberry应用程序,我需要从手机中获取配置文件列表(用于声音设置)。
有没有办法获取个人资料信息?
答案 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();
}
}
}