The SWAPI (Star Wars API) SDK for Android
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
SWAPI_SDK
.gitignore
README.md

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
    }
});