{"componentChunkName":"component---src-templates-markdown-template-jsx","path":"/guides/analytics/analytics-deprecated/developer-docs/sdks/java/","result":{"data":{"pageMetadata":{"title":"Java","path":"/guides/analytics/analytics-deprecated/developer-docs/sdks/java/","sourceCode":null,"metadataParent":{"title":"SDKs","path":"/guides/analytics/analytics-deprecated/developer-docs/sdks/","sourceCode":null,"hasVersionPicker":null,"metadataChildren":[{"title":"SDKs Introduction","path":"/guides/analytics/analytics-deprecated/developer-docs/sdks/introduction/","order":6.1,"label":null},{"title":"React Native","path":"/guides/analytics/analytics-deprecated/developer-docs/sdks/react-native/","order":6.2,"label":null},{"title":"iOS","path":"/guides/analytics/analytics-deprecated/developer-docs/sdks/iOS/","order":6.3,"label":null},{"title":"Android","path":"/guides/analytics/analytics-deprecated/developer-docs/sdks/android/","order":6.4,"label":null},{"title":"Java","path":"/guides/analytics/analytics-deprecated/developer-docs/sdks/java/","order":6.4,"label":null},{"title":"JavaScript","path":"/guides/analytics/analytics-deprecated/developer-docs/sdks/javascript/","order":6.5,"label":null},{"title":"Python","path":"/guides/analytics/analytics-deprecated/developer-docs/sdks/python/","order":6.6,"label":null},{"title":"Object API","path":"/guides/analytics/analytics-deprecated/developer-docs/sdks/object-api/","order":6.7,"label":null}],"metadataParent":{"title":"Developer Docs","path":"/guides/analytics/analytics-deprecated/developer-docs/","metadataChildren":[{"title":"Introduction","path":"/guides/analytics/analytics-deprecated/developer-docs/introduction/","order":1,"label":null},{"title":"Integrations","path":"/guides/analytics/analytics-deprecated/developer-docs/integrations/","order":4,"label":null},{"title":"Data Warehouses and Data Lakes","path":"/guides/analytics/analytics-deprecated/developer-docs/data-warehouses-lakes/","order":5,"label":null},{"title":"APIs","path":"/guides/analytics/analytics-deprecated/developer-docs/apis/","order":6,"label":null},{"title":"SDKs","path":"/guides/analytics/analytics-deprecated/developer-docs/sdks/","order":6,"label":null},{"title":"Developer Basics","path":"/guides/analytics/analytics-deprecated/developer-docs/developer-basics/","order":7,"label":null}],"metadataParent":{"title":"Analytics (Deprecated)","path":"/guides/analytics/analytics-deprecated/","metadataChildren":[{"title":"Introduction","path":"/guides/analytics/analytics-deprecated/introduction/","order":1.1,"label":null},{"title":"Developer Docs","path":"/guides/analytics/analytics-deprecated/developer-docs/","order":4,"label":null},{"title":"Identity Providers","path":"/guides/analytics/analytics-deprecated/identity-providers/","order":null,"label":null},{"title":"Settings","path":"/guides/analytics/analytics-deprecated/settings/","order":null,"label":null}],"metadataParent":{"title":"Analytics","path":"/guides/analytics/","metadataChildren":[{"title":"Introduction","path":"/guides/analytics/introduction/","order":1,"label":null},{"title":"Core Analytics (Beta)","path":"/guides/analytics/core-analytics/","order":1.1,"label":null},{"title":"Analytics Free Trial","path":"/guides/analytics/analytics-free-trial/","order":2,"label":null},{"title":"Setup","path":"/guides/analytics/setup/","order":3,"label":null},{"title":"Settings","path":"/guides/analytics/settings/","order":4,"label":null},{"title":"Analytics Data Manager","path":"/guides/analytics/data-manager/","order":5,"label":null},{"title":"Analyses","path":"/guides/analytics/analyses/","order":6,"label":null},{"title":"Query Builder","path":"/guides/analytics/query-builder/","order":6,"label":null},{"title":"User Aliasing","path":"/guides/analytics/user-aliasing/","order":7,"label":null},{"title":"Dashboards","path":"/guides/analytics/dashboards/","order":8,"label":null},{"title":"Analytics Resources","path":"/guides/analytics/resources/","order":10,"label":null},{"title":"User Segments","path":"/guides/analytics/user-segments/","order":10,"label":null},{"title":"Tutorials","path":"/guides/analytics/tutorials/","order":11,"label":null},{"title":"APIs","path":"/guides/analytics/apis/","order":12,"label":null},{"title":"Analytics (Deprecated)","path":"/guides/analytics/analytics-deprecated/","order":13,"label":null}],"metadataParent":{"title":"Guides","path":"/guides/","metadataChildren":[{"title":"Platform Overview","path":"/guides/platform-overview/","order":0.5,"label":null},{"title":"Getting Started","path":"/guides/getting-started/","order":1,"label":null},{"title":"mParticle Agent","path":"/guides/mparticle-agent/","order":1.5,"label":null},{"title":"Oversight","path":"/guides/oversight/","order":2,"label":null},{"title":"Data Platform","path":"/guides/data-platform/","order":3,"label":null},{"title":"Data Warehouse","path":"/guides/data-warehouse/","order":4,"label":null},{"title":"Customer 360","path":"/guides/customer-360/","order":5,"label":null},{"title":"Analytics","path":"/guides/analytics/","order":6,"label":null},{"title":"Audiences","path":"/guides/audiences/","order":7,"label":null},{"title":"Settings","path":"/guides/settings/","order":8,"label":null},{"title":"Troubleshooting mParticle","path":"/guides/troubleshooting/","order":10,"label":null},{"title":"Default Service Limits","path":"/guides/default-service-limits/","order":11,"label":null},{"title":"Glossary","path":"/guides/glossary/","order":12,"label":null}]}}}}}},"markdownRemark":{"html":"<aside class=\"warning\">\n<strong>Analytics Sunset</strong><br />\nWe began sunsetting mParticle Analytics on October 1, 2026. As a result, the features and workflows described on this page may no longer be available. This documentation is retained for reference. If you have questions about how this change affects your account, contact your mParticle account representative.\n</aside>\n<p>If you’re integrating with a Maven project, just add the following dependency to your pom.xml file:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre style=\"counter-reset: linenumber NaN\" class=\"language-text line-numbers\"><code class=\"language-text\">&lt;dependency&gt;\n    &lt;groupId&gt;com.indicative.client.java&lt;/groupId&gt;\n    &lt;artifactId&gt;indicative-java&lt;/artifactId&gt;\n    &lt;version&gt;1.0.3&lt;/version&gt;\n&lt;/dependency&gt;</code><span aria-hidden=\"true\" class=\"line-numbers-rows\" style=\"white-space: normal; width: auto; left: 0;\"><span></span><span></span><span></span><span></span><span></span></span></pre></div>\n<p>Otherwise, <a href=\"https://github.com/Indicative/Indicative-Java/\">download the client</a> and add the Indicative.java file (located in /src/main/java/com/indicative/client/java) to your project.</p>\n<p>To start tracking events, first call the apiKey() method and pass in your API key, like so:</p>\n<p><code class=\"language-text\">Indicative.apiKey(&quot;Your-API-Key-Goes-Here&quot;);</code></p>\n<p>You should only have to do that once. Alternatively, you can hardcode the value of API_KEY at the top of the file. Once your API key is set, you can record events with a single line of code:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre style=\"counter-reset: linenumber NaN\" class=\"language-text line-numbers\"><code class=\"language-text\">Indicative.event(&quot;Registration&quot;).uniqueId(&quot;user47&quot;)\n        .addProperty(&quot;Gender&quot;,&quot;Female&quot;).addProperty(&quot;Age&quot;, 23)\n        .done();</code><span aria-hidden=\"true\" class=\"line-numbers-rows\" style=\"white-space: normal; width: auto; left: 0;\"><span></span><span></span><span></span></span></pre></div>\n<p>The static method event() takes the name of the event as a String argument. It returns a newly instantiated Event object. Note that all of the following methods (aside from done()) return the modified Event object, allowing them to be chained together as in the example.</p>\n<p>Next, the <code class=\"language-text\">uniqueId()</code> method takes one String argument, which is the unique identifier associated with the user performing the action.</p>\n<p>The <code class=\"language-text\">addProperty()</code> method takes two String arguments for the name and value of the property, respectively. This method is overloaded so that you can pass in int, long, float, double, and boolean property values without having to convert them to Strings yourself.</p>\n<p>Finally, you must call done() to asynchronously post the event to our REST endpoint.</p>\n<p>This client also includes several unit tests in the IndicativeTest.java file (located in /src/test/java/com/indicative/client/java).</p>","frontmatter":{"title":"Java","order":6.4,"seoTitle":null,"seoDescription":null},"parent":{"__typename":"File","modifiedTime":"October 12, 2026"}}},"pageContext":{"slug":"/guides/analytics/analytics-deprecated/developer-docs/sdks/java/"}},"staticQueryHashes":["2950460867"]}