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

Regular Contributor
Posts: 94
Registered: ‎08-07-2010
My Device: 9550

problem in using Blackberry Analytics Api in our Application




I  want  to use Blackberry Analytics API in my application.  I have used that api in my application as ,


My Application Name is SampleApplication,  I want the suggestion that is this code correct. I have used the /Sample Application/ as the event path for onButtonClick event  .



------------------> My Main Class



package com.sampleapplication.ui;


public class Main extends WebtrendsUiApplication {
     Main() {
        pushScreen(new HomeScreen());
     public static void main(String[] args) {


         WebtrendsConfigurator.LoadConfigFile("com.sampleapplication.ui.Main", "config.xml");
         WebtrendsDataCollector dataCollector = WebtrendsDataCollector.getInstance();

         }catch (Exception e) {
            System.out.println("error message"+e.getMessage());
     new Main().enterEventDispatcher();


-------- > my Screen Class,  HomeScreen


package com.sampleapplication.ui;


public class HomeScreen extends MainScreen {

        ButtonField click_buttonButtonField = new ButtonField("Click Me", ButtonField.CONSUME_CLICK| FOCUSABLE);
        click_buttonButtonField.setChangeListener(new FieldChangeListener() {
        public void fieldChanged(Field field, int context) {

                WebtrendsDataCollector.getInstance().onButtonClick("/Sample Application/Main/",                       "HomeScreen", "Click Me", null);


     Status.show("Button Field Clicked"); 
            catch (IllegalWebtrendsParameterValueException err)