Coder Social home page Coder Social logo

edsm-android's Introduction

Elite: Dangerous Star Map Android Client

Build Status

A client library for the Elite: Dangerous Star Map APIs.

I've found several Mac, Windows, and iOS tools leveraging the EDSM APIs, but nothing geared specifically to our Android developer friends, myself included.

My hope is that this easy to use library will help innovate more tools available on our Android devices.

You can check out the other Elite: Dangerous tools I've created for Android at my github

Installation

  • Library is available through jcenter and jitpack.io.

For gradle projects using jcenter repositories include the following in your build script:

dependencies {
    implementation 'com.github.stpatrck:edsm:+'
}

For gradle projects using jitpack.io repositories include the following in your build script:

dependencies {
    implementation 'com.github.StPatrck:edsm-android:+'
}

Usage

  • First, initialize the client class EdsmClient.java with your application context. It is highly recommended to do this when the Application.onCreate() method is invoked.
public class MyApplication extends Application {
    
    public void onCreate() {
        super.onCreate();
        
        EdsmClient.init(MyApp.getInstance());
    }
}
  • If you are running in debug mode the Server should be set to Test to avoid overloading the EDSM servers during development and testing. Since EdsmClient is a singleton, use EdsmClient.getInstance() to get the current instance of the client in order to set the server.
public class MyApplication extends Application {
    
    public void onCreate() {
        super.onCreate();
        
        EdsmClient.init(MyApp.getInstance());
        
        // EdsmClient defaults to ServerTest, so explicitly set it to
        // production when not running debug builds.
        if (!BuildConfig.DEBUG)
            EdsmClient.getInstance().setServer(Server.Production);
            
    }
}
  • Now is also a good time to configure logging...
public class MyApplication extends Application {
    
    public void onCreate() {
        super.onCreate();
        
        EdsmClient.init(MyApp.getInstance());
        
        // EdsmClient defaults to ServerTest, so explicitly set it to
        // production when not running debug builds.
        if (!BuildConfig.DEBUG)
            EdsmClient.getInstance().setServer(Server.Production);
        else
            EdsmClient.getInstance().setLoggingEnabled(true);
        
    }
}
  • And that's all! You can now call any of the EdsmClient APIs.

Notes

A few notes on usage:

  • Most importantly, I am not in any way affiliated with Frontier Games or any of the Elite: Dangerous developers. This is a pet project of an avid fan of the games.
  • The client is still under heavy development so some features may contain bugs (like any other software) and have room for improvement. Please create issues and/or pull requests and I will address them as time permits.

Special Thanks

I would like to give a very special thank you to developers and contributors of the EDSM site. Without them this library and the vast wealth of data about the cosmos would not be available.

edsm-android's People

Contributors

saintpatrck avatar

Watchers

James Cloos avatar  avatar

edsm-android's Issues

System Search Crash

System search causes a crash when the system names List is null.

Proper validation should be performed prior to acting upon a nullable object.

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.