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
Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd
Accepted Solution

regarding Analytics Service

i want to use analytic service in my app,i have read the documentation ,i'm new to BB plz  anyone explain me the following code.

addMenuItem(new SendAnalyticsEvent("AdClickEvent", new Runnable() {

			public void run() {
				try {
					WebtrendsDataCollector.getInstance().onAdClickEvent("/mainscreen", "Main Screen", "menu", null, "Demo Ad");
				} catch (IllegalWebtrendsParameterValueException e) {
					System.out.println(e.toString());
				}
			}
		}));

 

Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: regarding Analytics Service

for example, i have screen with button,now i wan to detect that click event with analytic service, here is my code now plz any one explain me how to use analytic for button click event in my mainscreen,plz explain me for my basic understanding.

 

public class MyApp extends WebtrendsUiApplication
{
	static MainScreen splashScreen = null;
	
    public static void main(String[] args)
    {
        // Create a new instance of the application and make the currently
        // running thread the application's event dispatch thread.
        MyApp theApp = new MyApp();       
        theApp.enterEventDispatcher();
    }
    
    public MyApp()
    {        
    	WebtrendsConfigurator.LoadConfigFile("mypackage","config.xml");
			WebtrendsDataCollector wtDC = WebtrendsDataCollector.getInstance();
			wtDC.Initialize();
			
			splashScreen = new splashScreen();
			pushScreen(splashScreen);
    	
    }

}
public class splashScreen extends MainScreen{
     public splashScreen (){
     ButtonField addButton = new ButtonField("Add");
         
          
          add(addButton);
                 

    }

}

 

Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: regarding Analytics Service

plz solve my issue..?
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: regarding Analytics Service

Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: regarding Analytics Service

that really helps me, but i did not understand the parameters in onButtonclick() ,i mean plz can u explain the parameters in the following line

WebtrendsDataCollector.getInstance().onButtonClick("/AnalyticsDemo/Main/", "MainScreen", "help click", null);
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: regarding Analytics Service

Have you read the other pages related to this service:- see attached image for a hint on how to find them.  Just like the other documentation pages of course.... 

 

Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: regarding Analytics Service

yes, i have read the documentation ,but not able to understand properly
so plz can u explain the first parameter,i mean in onButtonClick("/AnalyticsDemo/Main/", "MainScreen", "help click", null);
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: regarding Analytics Service

[ Edited ]

So which of theses words from the documentation, do you not understand?

"Specifies the hierarchical location of where an object or content is located in an application"

Super Contributor
Posts: 425
Registered: ‎01-02-2013
My Device: BOLD 9900
My Carrier: sdvsdvsd

Re: regarding Analytics Service

ok,and in the 2nd parameter we have to write the class name or just
simply Mainscreen..?
i have posted code in 2nd post where my first class is MyApp and a splashscreen which extends Mainscreen with button,
now in the second parameter i have to write splashscreen or Mainscreen..?
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: regarding Analytics Service

Remember, our job is NOT to read your code, our job is to answer your questions.  Posting code and saying "please explain" is just as bad as posting code and saying "it doesn't work".  We have no idea what you need explained and more importantly, what you already understand.  So unless we are prepared to write a comprehensive explanation, then we won't respond to questions like "please explain" because answering the question would take too much time. 

 

Take the time to write down the questions that you have in detail,  In this case it seems to me you don't understand the parameters.  Can you please tell us the parameters you don't understand, referencing the documentation and the words in the documentation that are not clear to you.

 

Sorry to go on about it, but it is in your own interest to do the research and explain your problem clearly and completely.  You have effectively wasted 6 hours already on this problem because you expected people to do this work for you.  Your job is to minimize the effort that responders have to go to, by being clear on your request right from the start. 

 

In this case, your initial question could have been along the lines:

"I don't understand what these parameters are, can anyone point me at any documentation that might help me?".

Alternatively, if you had already found the documentation, the question should have been along the lines that I have requested above. 

 

Do this in future if you expect people to reply.  And respond to my question (in bold) above to get a response on this question. 

 

OK?