Class CodenameOneAnalyticsProvider

java.lang.Object
com.codename1.analytics.AbstractAnalyticsProvider
com.codename1.analytics.CodenameOneAnalyticsProvider
All Implemented Interfaces:
AnalyticsProvider

public class CodenameOneAnalyticsProvider extends AbstractAnalyticsProvider

The Codename One first-party analytics provider. It batches events and posts them as JSON to the Codename One cloud (/api/v2/analytics/events), where they are stored and aggregated for the reports shown in the developer console. The capabilities you actually get (screen views, custom events, retention window, raw export) are gated server-side by your subscription tier.

App identity is read from the build-injected Display properties (build_key, package_name, AppName, AppVersion, OSVer) -- the same mechanism the on-device crash client uses -- so no API key needs to be embedded in the app. Events are buffered in memory and flushed when the batch fills up or when flush() is called.

Analytics.addProvider(new CodenameOneAnalyticsProvider());
Analytics.setConsent(AnalyticsConsent.granted());