2
對於每一個簡單的問題,是否有任何可能的方式通過編程獲得黑莓BBM日誌的應用程序。獲取BBM聊天記錄
以下任務我做: -
- 下載&在項目整合BBM SDK。
- 按照BBM Development Guide。
這裏是我的代碼: -
public void getBBM_Logs()
{
BBMPlatformContext platformContext =null;
try
{
platformContext = BBMPlatformManager.register(new MyBBMAppPlugin());
if(platformContext != null)
{
ContactListService contactListService = platformContext.getContactListService();
BBMPlatformContactList contacts = contactListService.getContactList();
Enumeration contactsEnum = contacts.getAll();
while(contactsEnum.hasMoreElements())
{
BBMPlatformContact contact = (BBMPlatformContact)contactsEnum.nextElement();
add(new LabelField(contact.getDisplayName()));
}
}
}
catch (ControlledAccessException e)
{
// The BBM platform has been disabled
}
if (platformContext != null)
{
MyBBMPlatformContextListener platformContextListener;
platformContextListener = new MyBBMPlatformContextListener();
platformContext.setListener(platformContextListener);
}
}
private class MyBBMPlatformContextListener extends BBMPlatformContextListener
{
public void accessChanged(boolean isAccessAllowed, int accessErrorCode)
{
if (!isAccessAllowed)
{
// You cannot access the BBM platform
}
}
public void appInvoked(int reason, Object param)
{
// Code for handling different contexts for invocation
}
}
private class MyBBMAppPlugin extends BBMPlatformApplication
{
public MyBBMAppPlugin()
{
super("57888721-1e52-4171-a8a4-0559eab8efdf");
}
}
請讓我知道,是否有任何可能的方式來獲得ChatLogs。
..謝謝男人! –