One of the features in Codename One that just never got any attention is builtin support for analytic instrumentation. Currently Codename One has builtin support for Google Analytics which provides reasonable enough statistics of application usage.
The infrastructure is there to support any other form of analytics solution of your own choosing.
Analytics is pretty seamless for a GUI builder application since navigation occurs via the Codename One API and can be logged without developer interaction. However, to begin the instrumentation one needs to add the line:
AnalyticsService.init(agent, domain);
To get the value for the agent value just create a Google Analytics account and add a domain, then copy and paste the string that looks something like UA-99999999-8 from the console to the agent string. Once this is in place you should start receiving statistic events for the application.
If your application is not a GUI builder application or you would like to send more detailed data you can use the Analytics.visit() method to indicate that you are entering a specific page.
Monday, April 30, 2012
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment