FancyAnalyticsGetting started
Java SDK
The Java SDK for FancyAnalytics
The FancyAnalytics platform is still in development. Expect breaking changes in the future.
If you are a Java developer, who wants to track metrics about your Java application, without being in the Minecraft ecosystem, you can use our Java SDK. The Java SDK is a general purpose SDK which can be used to track metrics about any Java application.
Include the Java SDK
Gradle
repositories {
maven("https://repo.fancyinnovations.com/releases")
}dependencies {
implementation("de.oliver.fancyanalytics:java-sdk:VERSION")
}Maven
<repository>
<id>fancyplugins-releases</id>
<name>FancyPlugins Repository</name>
<url>https://repo.fancyinnovations.com/releases</url>
</repository><dependency>
<groupId>de.oliver.FancyAnalytics</groupId>
<artifactId>java-sdk</artifactId>
<version>VERSION</version>
</dependency>Make sure to shade the API into your app!
Use the API
Initialize the ApiClient
First you need to create an instance of the ApiClient class.
ApiClient fancyAnalytics = new ApiClient("https://api.fancyanalytics.net", "", "YOUR API TOKEN");Send metric data
You can send metric data to the server using the record service.
Record record = new Record("unique sender id", "project id", timestamp, new HashMap<>());
record.withEntry("metric name", "metric value");
fancyAnalytics.getRecordService().createRecord("project id", record);Send events
You can also send events to the server using the event service.
Event event = new Event("event name", new HashMap<>());
event.withProperty("prop key", "prop value");
fancyAnalytics.getEventService().createEvent("project id", event);