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


US Stock 10 Units 100K B100K OHM Linear Taper Rotary Potentiometer POT Red Knob picture

US Stock 10 Units 100K B100K OHM Linear Taper Rotary Potentiometer POT Red Knob

$9.49



Clarostat RA20LASD103A 10K OHM Wirewound 10000 Ohm Potentiometer Industrial POT picture

Clarostat RA20LASD103A 10K OHM Wirewound 10000 Ohm Potentiometer Industrial POT

$14.19



US Stock 5K Potentiometer RV24YN 20S B502 24mm with knob and Digital Scale picture

US Stock 5K Potentiometer RV24YN 20S B502 24mm with knob and Digital Scale

$11.96



10 PCS 1K,2 K,5K,10K,20K100K,1Mohm Linear Taper Rotary Potentiometer US Stock picture

10 PCS 1K,2 K,5K,10K,20K100K,1Mohm Linear Taper Rotary Potentiometer US Stock

$9.49



US Stock 10 Units 1K B1K OHM Linear Taper Rotary Potentiometer POT  Orange Knob picture

US Stock 10 Units 1K B1K OHM Linear Taper Rotary Potentiometer POT Orange Knob

$8.99



10 turn Potentiometer 3590S Wirewound Variable Resistor Precision multi-turn POT picture

10 turn Potentiometer 3590S Wirewound Variable Resistor Precision multi-turn POT

$51.49







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