Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 275
Registered: ‎02-05-2010
My Device: Blackberry Z10
My Carrier: Bouygues Telecom
Accepted Solution

bbm integration

Hi all,

 

In the BBM SDK development guide, chapter Register your application with the BlackBerry Messenger
platform, at step 4 the app contructor is :

 

public MyBBMPlatformApp()
{
  myPlugin = new MyBBMAppPlugin();
  pushScreen(new MyBBMPlatformScreen());
  invokeLater(new Runnable()
  {
    public void run()
    {
       BBMPlatformContext platformContext =
       BBMPlatformManager.register(myPlugin);
       MyBBMPlatformContextListener platformContextListener;
       platformContextListener = new MyBBMPlatformContextListener();
       platformContext.setListener(platformContextListener);
    }
  }
  );
}

 

I would like to test the BBM6 presence before pushing my screen (I manage 2 screens, one with BBM6 support, one without BBM6 support).
Can I do that in the run method ?
Could someone provide a sample code ?


Thank your for your help.
Laurent

Twitter : @LaurentKP
My apps
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: bbm integration

Unfortunately it is not that easy.

 

On devices without BBM support your application will probably not even start because the classes you code refers to do not exist. 

 

This is recognized by the BBM developers and they have prepared a number of options for handling this.

 

Look at the Dependency Checker you will find on this page:

http://us.blackberry.com/developers/blackberrymessenger/

Developer
Posts: 275
Registered: ‎02-05-2010
My Device: Blackberry Z10
My Carrier: Bouygues Telecom

Re: bbm integration

As you said, it's not so easy !!!


I thought I've done the hardest work with the integration of BBM in my app, but this Dependency Checker thing, it's a big deal...

 

I'm not sure to implement one of the solution provided.
Maybe I'll just mention in the app description "This application will work only if BBM 6 is installed on your device".

 

Thank you Peter.

Twitter : @LaurentKP
My apps
Developer
Posts: 31
Registered: ‎08-05-2011
My Device: 9550
My Carrier: Vodafone

Re: bbm integration

 

/*********************************************************************/
Please press the like button on the right side to thank me if my reply helped you and please mark posts as solved if you found a solution.
Developer
Posts: 31
Registered: ‎08-05-2011
My Device: 9550
My Carrier: Vodafone

Re: bbm integration

I am new to this forum, so plz correct me if i am wrong somewhere.....

 

I am also trying to do the same, trying to call the BBM from my application. Actually my application allows user to send messages. Its working with using the usual api for sending SMS.

 

But I want to use the BBM api for this. I am stuck there. Downloaded the SDK v1.1 from BB site.

 

 

 

I am pasting here sample of my code;--

 

 

/***/

public class Helloworld extends UiApplication {

    private MyBBMAppPlugin myPlugin;
    public static BBMPlatformContext platformContext = null;

    private Helloworld() {

        myPlugin = new MyBBMAppPlugin(); // com.rim.samples.helloworld.Helloworld//0x6df828e7d2d23240L
        pushScreen(new HelloworldScreen());
        invokeAndWait(new Runnable() {

            public void run() {
                // TODO Auto-generated method stub

                platformContext = BBMPlatformManager.register(myPlugin);
                MyBBMPlatformContextListener platformContextListener;
                platformContextListener = new MyBBMPlatformContextListener();
                platformContext.setListener(platformContextListener);
            }
        });
    }


    /*******************************************/
    private class MyBBMAppPlugin extends BBMPlatformApplication {
        public MyBBMAppPlugin() {
            super("470527a2-b250-42fe-8c94-b0401d1405c4");
        }
    }

    /*******************************************/
    private class MyBBMPlatformContextListener extends
            BBMPlatformContextListener {
        public void accessChanged(boolean isAccessAllowed, int accessErrorCode) {
            if (!isAccessAllowed) {
                // You cannot access the BBM platform
                Dialog.alert("You cannot access the BBM platform");
            }
        }

        public void appInvoked(int reason, Object param) {
            // Code for handling different contexts for invocation
        }
    }

    /*********************************************/
    public static void main(String[] args) {
        Helloworld theApp = new Helloworld();
        if (theApp != null) {
            theApp.requestForeground();
        } else {
            theApp = new Helloworld();
            theApp.enterEventDispatcher();
        }
    }

    /********************************************/
    private class HelloworldScreen extends MainScreen{

 

// In this screen I have some Buttons on click os one Buttob i am trieng to invoke the BBM api.

// some what like this

 

 

  UiApplication.getUiApplication().pushScreen(
                                        new MyBBMChatScreen(
                                                Helloworld.platformContext));

 

}

 

 

i am getting  the context as null. Also an Exception that says" Missing Native Error"  when I run my app in the simulator. By the way i am using Simpackage - 6.0.*.*.*   The Emulator is 9800.

Also MDS is running in blackground.


/*********************************************************************/
Please press the like button on the right side to thank me if my reply helped you and please mark posts as solved if you found a solution.
Contributor
Posts: 16
Registered: ‎05-11-2010
My Device: 8900
My Carrier: Orange

Re: bbm integration

Hi mayureshg,

 

Did you find a solution to your problem ? I have the same error "Missing Native App" when calling BBM SDK. I'm using the right MDS , and the sim1.bat sim2.bat for BlackBerry 9800 provided in the BBM SDK package.


Thanks for your help,

Antoine.

Contributor
Posts: 41
Registered: ‎07-19-2011
My Device: 9500
My Carrier: airtel

Re: bbm integration

Hi I am also facing same problem. I am unable to test the application in simulator the sim1.bat sim2.bat for BlackBerry 9800 provided in the BBM SDK package. Please suggest me an idea or solution
Developer
Posts: 31
Registered: ‎08-05-2011
My Device: 9550
My Carrier: Vodafone

Re: bbm integration

Sorry for a late reply.

 

I havn't got a solution for it still.


/*********************************************************************/
Please press the like button on the right side to thank me if my reply helped you and please mark posts as solved if you found a solution.