BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 05-01-2012, 02:20 AM   #1
clowicek
Knows Where the Search Button Is
 
clowicek's Avatar
 
Join Date: May 2007
Location: Czech republic
Model: 9360
PIN: 286E290E
Carrier: T-MOBILE CZ
Posts: 15
Default UserProfile - Blackberry Messenger SDK

Please Login to Remove!

Hello All,
for first time... i`m sorry for my english.
Now to my problem. I programmed an application that uses information from BBM ... The application has a splash screen and when I am start application as it is properly registered in my BBM where it and i see it. Nevertheless, he ends up splash screen so I do not have access to information from BBM. Rather, I am unable to initialize BBMPlatformContext in new screen so that I could use userprofile USERPROFILE = platformContext.getUserProfile (), etc.
probably doing something wrong but I'm not in a state to find out what.

this is code which started if application run (BBM is already registered)
Code:
import net.rim.device.api.system.ControlledAccessException;
import net.rim.device.api.ui.UiApplication;

import com.stepan.kutaj.APP.util.*;
import com.stepan.kutaj.APP.screen.*;
import net.rim.blackberry.api.bbm.platform.BBMPlatformApplication;
import net.rim.blackberry.api.bbm.platform.BBMPlatformContext;
import net.rim.blackberry.api.bbm.platform.BBMPlatformContextListener;
import net.rim.blackberry.api.bbm.platform.BBMPlatformManager;

public class APP  extends UiApplication{

	private BBMPlatformContext platformContext = null;
	private MyBBMAppPlugin myPlugin;
	
	public APP() 
	{
		myPlugin = new MyBBMAppPlugin();
		invokeLater(new Runnable()
        {
           public void run()
           {
              try 
              {
					platformContext = BBMPlatformManager.register(myPlugin);
              }
              catch (ControlledAccessException e) 
              {
                 // The BBM platform has been disabled
              }
              if (platformContext != null) 
              {
                 MyBBMPlatformContextListener platformContextListener;
                 platformContextListener = new MyBBMPlatformContextListener();
                 platformContext.setListener(platformContextListener);
                 
              }
              
           }
        }
		);
		
		pushScreen(new SplashScreen(UiApplication.getUiApplication(), new RegistrationScreen()));
	}

	public static void main(String[] args) 
	{
		APP app = new APP();
		app.enterEventDispatcher();
	}
	
	
	private class MyBBMAppPlugin extends BBMPlatformApplication
    {
        public MyBBMAppPlugin()
        {
            super( "UUID" );
        }
    }
	
    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
        }
    }
}
this is next screen where i don`t implement BBMPlatformContext
Code:
import net.rim.blackberry.api.bbm.platform.*;
import net.rim.blackberry.api.bbm.platform.profile.*;
import net.rim.device.api.ui.container.*;
import java.util.*;

public class RegistrationScreen extends MainScreen 
{    
    public RegistrationScreen(BBMPlatformContext platformContext) 
    {
        UserProfile userProfile = platformContext.getUserProfile();
        
        String displayName = userProfile.getDisplayName();
        Bitmap displayPicture = userProfile.getDisplayPicture();
        String personalMsg = userProfile.getPersonalMessage();
        int status = userProfile.getStatus();
        String statusMsg = userProfile.getStatusMessage();
    }
}
i try this and everything application end with error that i cannot access to modul
Code:
import net.rim.device.api.system.ControlledAccessException;
import net.rim.device.api.ui.UiApplication;

import com.stepan.kutaj.APP.util.*;
import com.stepan.kutaj.APP.screen.*;
import net.rim.blackberry.api.bbm.platform.BBMPlatformApplication;
import net.rim.blackberry.api.bbm.platform.BBMPlatformContext;
import net.rim.blackberry.api.bbm.platform.BBMPlatformContextListener;
import net.rim.blackberry.api.bbm.platform.BBMPlatformManager;

public class APP  extends UiApplication{

	private BBMPlatformContext platformContext = null;
	private MyBBMAppPlugin myPlugin;
	
	public APP() 
	{
		myPlugin = new MyBBMAppPlugin();
		invokeLater(new Runnable()
        {
           public void run()
           {
              try 
              {
					platformContext = BBMPlatformManager.register(myPlugin);
              }
              catch (ControlledAccessException e) 
              {
                 // The BBM platform has been disabled
              }
              if (platformContext != null) 
              {
                 MyBBMPlatformContextListener platformContextListener;
                 platformContextListener = new MyBBMPlatformContextListener();
                 platformContext.setListener(platformContextListener);
                 
              }
              
           }
        }
		);
		
		pushScreen(new SplashScreen(UiApplication.getUiApplication(), new RegistrationScreen(platformContext))); 
	}

	public static void main(String[] args) 
	{
		APP app = new APP();
		app.enterEventDispatcher();
	}
	
	
	private class MyBBMAppPlugin extends BBMPlatformApplication
    {
        public MyBBMAppPlugin()
        {
            super( "UUID" );
        }
    }
	
    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
        }
    }
}
Thank you for help!!!

Best regards,

Stepan
__________________
Stepan
----------------------------------------------------
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads for: UserProfile - Blackberry Messenger SDK
Thread Thread Starter Forum Replies Last Post
Web Desktop 5 no application loader Walter_Str BES Admin Corner 2 08-27-2009 07:05 AM
New to BES admin , need help with messages. bigwig BES Admin Corner 5 10-17-2007 10:59 AM
BES 4.1 for Exchange - Now Available to TSupport Customers jibi BES Admin Corner 86 03-31-2006 12:06 PM
BES Domino 4.0 SP2 rsun BES Admin Corner 12 08-25-2005 01:27 PM
[2005-05-11] BlackBerry Connection bfrye BlackBerry In the News 0 05-11-2005 09:16 AM


New 2 Sets of 2 (4) keys total OEM 9952 IBM Keys for Cash Drawers Displays Locks picture

New 2 Sets of 2 (4) keys total OEM 9952 IBM Keys for Cash Drawers Displays Locks

$14.99



Lot of 2 IBM Correctable Ribbon Cassette Black 1299300 NOS Original OEM picture

Lot of 2 IBM Correctable Ribbon Cassette Black 1299300 NOS Original OEM

$12.00



Vintage OEM IBM Selectric Typewriter Backspace #1205779 picture

Vintage OEM IBM Selectric Typewriter Backspace #1205779

$14.95



IBM CASH DRAWER KEY'S #9960 SET OF 2 KEYS. AFTERMARKET KEY'S SAME AS OEM 33G3360 picture

IBM CASH DRAWER KEY'S #9960 SET OF 2 KEYS. AFTERMARKET KEY'S SAME AS OEM 33G3360

$18.00



IBM 1134818 K-C26-Aots 115V 1625 RPM 1.20 amp Motor Selectric II OEM picture

IBM 1134818 K-C26-Aots 115V 1625 RPM 1.20 amp Motor Selectric II OEM

$99.95



OEM  IBM Type 5441 WheelWriter 3 1356658 1362400-02 Main Boards Tested Working picture

OEM IBM Type 5441 WheelWriter 3 1356658 1362400-02 Main Boards Tested Working

$49.99







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.