Using the Equo SDK

In this section, we will explore how to use the Equo SDK in your application.

Using the Equo SDK in a Java Application with Maven

Java Maven Application

To consume our libraries in your Maven-based project, you need to place the following lines in your pom.xml file.:

<properties>
  <maven.compiler.source>11</maven.compiler.source>
  <maven.compiler.target>11</maven.compiler.target>
</properties>

<dependencies>
  <dependency>
    <groupId>dev.equo</groupId>
    <artifactId>dev.equo.sdk</artifactId>
    <version>0.0.2</version>
  </dependency>
</dependencies>

<repositories>
  <repository>
    <url>https://dl.equo.dev/chromium-swt-ee/equo-gpl/mvn</url>
  </repository>
</repositories>

OSGi Maven Application

If you want to run OSGi as your application runtime you need to add the following dependencies. Here is a pom.xml file example:

<properties>
  <maven.compiler.source>11</maven.compiler.source>
  <maven.compiler.target>11</maven.compiler.target>
</properties>

<dependencies>
  <dependency>
    <groupId>dev.equo</groupId>
    <artifactId>dev.equo.sdk</artifactId>
    <version>0.0.2</version>
  </dependency>
    <dependency>
    <groupId>org.apache.felix</groupId>
    <artifactId>org.apache.felix.framework</artifactId>
    <version>7.0.5</version>
  </dependency>
  <dependency>
    <groupId>org.apache.felix</groupId>
    <artifactId>org.apache.felix.atomos</artifactId>
    <version>1.0.0</version>
  </dependency>
  <dependency>
    <groupId>org.apache.felix</groupId>
    <artifactId>org.apache.felix.scr</artifactId>
    <version>2.2.6</version>
  </dependency>
  <dependency>
    <groupId>org.eclipse.platform</groupId>
    <artifactId>org.eclipse.osgi.services</artifactId>
    <version>3.11.100</version>
  </dependency>
  <dependency>
    <groupId>org.eclipse.platform</groupId>
    <artifactId>org.eclipse.osgi.util</artifactId>
    <version>3.7.200</version>
  </dependency>
</dependencies>

<repositories>
  <repository>
    <url>https://dl.equo.dev/chromium-swt-ee/equo-gpl/mvn</url>
  </repository>
</repositories>

Then you can use OSGi features like the Service Registry, Dependency Model, Extender Pattern and some other OSGi Technologies.

Using the Equo SDK in a Java Application with Gradle

Java Gradle Application

To consume our libraries in your Gradle-based project, you need to include the Equo repository and dependency in your build.gradle or build.gradle.kts file:

repositories {
  maven("https://dl.equo.dev/chromium-swt-ee/equo-gpl/mvn")
  mavenCentral()
}

dependencies {
  implementation("dev.equo:dev.equo.sdk:0.0.2")
}

OSGi Gradle Application

If you want to run OSGi as your application runtime you need to add the next Gradle capability. Here is a build.gradle.kts file example:

repositories {
  maven("https://dl.equo.dev/chromium-swt-ee/equo-gpl/mvn")
  mavenCentral()
}

dependencies {
  implementation("dev.equo:dev.equo.sdk:0.0.2")
  runtimeOnly("dev.equo:dev.equo.sdk:0.0.2") {
        capabilities {
            requireCapability("dev.equo:core-osgi-support")
        }
    }
}

Then you can use OSGi features like the Service Registry, Dependency Model, Extender Pattern and some other OSGi Technologies.

How can I run the application?

Java Application

Running an application using Equo SDK in Java is as simple as importing EquoApp, invoking EquoApp.create("APP-ID"), and then calling launch, as shown in the following example:

import com.equo.application.client.EquoApp;
import java.net.MalformedURLException;
import java.net.URL;

public class SimpleAppSample {
    public static void main(String[] args) throws MalformedURLException {
        EquoApp.create("SIMPLE-APP")
                .launch(new URL("https://equo.dev"));
    }
}

OSGi Application

Otherwise, running the application using OSGi is as simple as adding the addOSGICompatibilityLayer() method to the EquoBuilder, as shown in the following example:

import com.equo.application.client.EquoApp;
import java.net.MalformedURLException;
import java.net.URL;

public class SimpleAppSample {
    public static void main(String[] args) throws MalformedURLException {
        EquoApp.create("OSGI-APP")
                .addOSGICompatibilityLayer()
                .launch(new URL("https://equo.dev"));
    }
}
Equo Chromium, Middleware, and Comm API, are exclusively intended for use in applications developed using the Equo SDK. If you want to embed or integrate Equo Chromium, Middleware, or the Comm API in an existing application (i.e. Eclipse RCP), please contact us for a commercial license.