Merge branch 'master' of github.com:wordnik/swagger-codegen

This commit is contained in:
Tony Tam 2014-02-25 12:54:12 -08:00
commit 08466f615f

View File

@ -5,7 +5,7 @@ This is a full client library for the Wordnik API. It requires that you have a
can get one for free at http://developer.wordnik.com. can get one for free at http://developer.wordnik.com.
This library is built using the Wordnik [Swagger](http://swagger.wordnik.com) client library generator. You This library is built using the Wordnik [Swagger](http://swagger.wordnik.com) client library generator. You
can re-generate this library by running ./bin/java-wordnik-api.sh from the swagger-codegen project can re-generate this library by running ./bin/android-java-wordnik-api.sh from the swagger-codegen project
## Usage ## Usage
You can use maven central to add this library to your current project: You can use maven central to add this library to your current project:
@ -51,22 +51,17 @@ class WordOfTheDayAsyncTask extends AsyncTask<Void, Void, WordOfTheDay> {
WordsApi api = new WordsApi(); WordsApi api = new WordsApi();
api.addHeader("api_key", "YOUR_API_KEY"); api.addHeader("api_key", "YOUR_API_KEY");
try { try {
WordOfTheDay w = api.getWordOfTheDay("2014-02-19"); return api.getWordOfTheDay("2014-02-19");
if(w != null)
Log.d("FullscreenActivity", w.toString());
else
Log.d("FullscreenActivity", "nothing");
return w;
} }
catch (Exception e) { catch (Exception e) {
Log.d("FullscreenActivity", e.getMessage()); Log.d("WordOfTheDayAsyncTask", e.getMessage());
return null; return null;
} }
} }
@Override @Override
protected void onPostExecute(WordOfTheDay d) { protected void onPostExecute(WordOfTheDay d) {
activity.setWordOfTheDay(d); Log.d("WordOfTheDayAsyncTask", d.toString());
} }
} }
``` ```