Giter VIP home page Giter VIP logo

mbed-cloud-sdk-java's Introduction

Mbed Cloud SDK for Java

Status

The Mbed Cloud SDK provides a simplified interface to the Mbed Cloud APIs by exposing functionality using conventions and paradigms familiar to Java developers.

Prerequisites

Logging

  • The SDK uses SLF4j and hence, any supported logging framework (e.g. java.util.logging, logback, log4j) can be used by your application.

Distribution

In order to best meet your requirements, Java SDK is packaged in 3 different ways:

  • Individual Jars
  • Distribution ZIP. See related gradle plugin for more details.
  • A fat jar comprising the SDK and all its dependencies.

Getting started

Download

Artefacts listed above are published on JCenter and Maven Central. They can therefore be retrieved and included into your project using the package manager of your choice. To do so, please follow the instructions present on one of these artefact repositories (Bintray page of the project).

For example, if using Gradle, add the following compile dependency to build.gradle:

compile 'com.arm.mbed.cloud.sdk:mbed-cloud-sdk:1.x.y'

Current artefacts are not fully tailored for Android but can be used as is on this mobile platform. However, oltu dependency will have to be excluded to remove any compilation issue (e.g. Error converting bytecode to dex:\nCause: com.android.dex.DexException: Multiple dex files define Lorg/apache/oltu/oauth2/common/domain/credentials/Credentials). To do so, import the SDK in the gradle file, as follows:

implementation( 'com.arm.mbed.cloud.sdk:mbed-cloud-sdk:1.x.y' ){
    // Excluding a particular transitive dependency:
    exclude group: 'org.apache.oltu.oauth2'
}

Usage

These instructions can also be found in the official documentation:

  1. Create an API key on Mbed Cloud Portal.
  2. Import the SDK to your project using one of the packages listed above.
  3. Create a configuration object:
        String logLevel = "BODY"; //Defines the logging level of HTTP communications. See CallLogLevel for more information.
        String apiKey = "<apikey>"; //API key to use for contacting Mbed Cloud.
        ConnectionOptions config = new ConnectionOptions(apiKey);
        config.setClientLogLevel(CallLogLevel.getLevel(logLevel));
  4. You are ready to go.
        DeviceDirectory deviceApi = new DeviceDirectory(config);
        try {
            System.out.println(deviceApi.listDevices(null));
        } catch (MbedCloudException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

Versioning

The current version scheme used by the SDK reflects the version of the API it abstracts (e.g. 1.2.3 refers to 1.2 version of Mbed Cloud APIs). The last digit of the version corresponds to the SDK incremental version.

Documentation and examples

See the full documentation and API reference (i.e. javadoc) at https://cloud.mbed.com/docs/latest/mbed-cloud-sdk-java/. For usage examples, please have a look at the example project.

Contributing

Mbed Cloud SDK for Java is open source and we would like your help. There is a brief guide on how to get started in CONTRIBUTING.md.

Project

  • All code inside *.internal.* packages or annotated as @Internal is considered private API and should not be relied upon at all.
  • Classes annotated as @Module contain all Arm Mbed Cloud APIs
  • Methods annotated as @API are the functions which can be used to interact with Mbed Cloud.
  • APIs, objects or methods annotated as @Deprecated are supported until the next major release and will be removed later on. It is highly recommended to stop using them.
  • Methods with @Daemon annotation should be used to monitor SDK daemon threads.

Licence

License

Mbed Cloud SDK for Java is free-to-use and licensed under the Apache License 2.0. See LICENCE file for more information.

mbed-cloud-sdk-java's People

Contributors

acabarbaye avatar davidhyman avatar fheathco avatar madchutney avatar monty-bot avatar mray190 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.