Report is not updated in blackberry analytic
Asked Answered
D

1

10

I have developed the demo application of blackberry analytic service but report is not updated in my account my program is..

public class MyApp extends WebtrendsUiApplication {

    public static void main(String[] args) {
        MyApp theApp = new MyApp();
        theApp.enterEventDispatcher();
    }

    public MyApp() {
        WebtrendsConfigurator.LoadConfigFile(new AnalyticsConfig());
        WebtrendsDataCollector wtDC = WebtrendsDataCollector.getInstance();
        wtDC.Initialize();
        pushScreen(new MyScreen());

    }

    private class AnalyticsConfig extends WebtrendsConfig {

        public String wt_dc_app_name() {
            return "sample";
        }

        public String wt_dc_app_version() {
            return "1.0.1";
        }

        public String wt_dc_dcsid() {
            return "dcswcrmlj9dv0hgctfq9y6lw8_3w4g"; // Analytics Demo
        }

        public String wt_dc_debug() {
            return "true";
        }

        public String wt_dc_timezone() {
            return "+5";
        }

        public String wt_dc_url() {
            return "http://dc.webtrends.com/v1";
        }

        public String wt_dc_app_category() {
            return "Utilities";
        }

        public String wt_dc_app_publisher() {
            return "abc";
        }

    }
}



public final class MyScreen extends MainScreen implements FieldChangeListener{

    ButtonField b;

    public MyScreen() {
        b=new ButtonField();
        b.setChangeListener(this);
        add(b);
    }

    public boolean onClose() {
        try {
            WebtrendsDataCollector.getInstance().onApplicationTerminate("Application Terminate", null);
        } catch (IllegalWebtrendsParameterValueException err) {
            WebtrendsDataCollector.getLog().e(err.getMessage());
        }
        System.exit(0);

        return true;
    }

    public void fieldChanged(Field field, int context) {
        if(field==b){
            try {
                WebtrendsDataCollector.getInstance().onAdClickEvent("/mainscreen", "Main Screen", "menu", null, "Demo Ad");
            } catch (IllegalWebtrendsParameterValueException e1) {
                System.out.println(e1.toString());
                e1.printStackTrace();
            }
        }
    }
}

please find where is the problem. I have changed only the dcsid in the application .

Dhiren answered 20/12, 2012 at 10:53 Comment(1)
Side note: your onClose() method has a System.ext(0) and then a return true;. It would never reach the return.Oxblood
S
0

I know this question is quite old..but I wrote like a group of class u can use.. https://bitbucket.org/folorunsho1/googleanalyticsforblackberry

Stoughton answered 8/10, 2014 at 17:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.