The SWAPI (Star Wars API) SDK for Android
Java
Permalink
Failed to load latest commit information.
SWAPI_SDK Adding Utils class with some useful methods. Dec 24, 2014
.gitignore update gitignore Dec 21, 2014
README.md Minor fix in starWarsApi. Dec 22, 2014

README.md

SWAPI-Android-SDK

The SWAPI (Star Wars API) SDK for Android SWAPI SDk requires at minimum Java 7 or Android 4.0.

How to use it

Create a global instance in your application class

public class YourStarWarsApp extends Application {

    @Override
    public void onCreate() {
      super.onCreate();
      //Init star wars api
      StarWarsApi.init();
    }

}

In your activities or fragment you may fire every API call you want.

StarWarsApi.getApi().getAllPlanets(2, new Callback<PlanetList>() {
    @Override
    public void success(PlanetList simple, Response response) {
      //Do something cool
    }

    @Override
    public void failure(RetrofitError error) {
      //Something wrong
    }
});