Java

Apptimize supports server-side experimentation and release management through several server-oriented SDKs including Java.

Our server-side SDKs support programmatic experimentation (Dynamic Variables and Code Blocks) as well as Feature Flags.

Note: The Apptimize Java SDK officially supports Java 8 and above. Please contact us if you want to use the SDK but are on an earlier version of Java.

EU Cloud Site

Use the configAttributes flag to set your Apptimize region to EUCS if you are integrated in our EU Cloud site.

HashMap<String, Object> configAttributes = new HashMap<String, Object>();
configAttributes.put("apptimize_region", "eucs");
Apptimize.setup(<YOUR_APP_KEY>, configAttributes);

SDK Installation

Sign in to the Apptimize dashboard. You’ll see a welcome page that asks for the name of your app. After entering all your info, you’ll see these installation instructions again.

  1. Download the latest Java SDK from the SDK Download page.

  2. Include the jar within your project.

  3. In any files that use Apptimize, import the SDK using: import com.apptimize.Apptimize.

  4. You should now have access to all Apptimize APIs.

You can find our latest Java API Documentation here.

Maven

Apptimize versions after 1.2.24 are available from Maven.

  1. Add the appropriate repositories.

    If using POM files:

    <repository>
       <id>apptimize-repo</id>
       <url>https://maven.apptimize.com/artifactory/repo</url>
    </repository>
    

    If using gradle:

    repositories {
       maven { url 'https://maven.apptimize.com/artifactory/repo' }
    }
    
  2. Add the appropriate dependencies.

    If using POM files:

    <dependency>
       <groupId>com.apptimize</groupId>
       <artifactId>apptimize-java-server</artifactId>
       <version>1.2.24</version>
    </dependency>
    

    If using gradle:

    dependencies {
       implementation 'com.apptimize:apptimize-java-server:1.+'
    }
    

Initializing Apptimize

To initialize Apptimize, make the following call with the App Key associated with your app, which can be found on the Install tab of your dashboard. Note that the setup method is called for each unique session in which you are using the Apptimize API.

Apptimize.setup(<YOUR_APP_KEY>);