Giter Club home page Giter Club logo

marvelapiclientandroid's Introduction

Karumi logo Marvel Api Client written in Java Build Status Maven Central

This is an implementation written in Java for the Mavel Api. This library is implemented using Java 7 and it is fully compatible with Android.

IMPORTANT: This library is under development.

Usage

Prerequisites: You need to obtain valid Marvel keys for using this library. You can obtain it from [Marvel] marvelAuthorization

To start using the library you just need to create a valid MarvelApiConfiguration:

MarvelApiConfig marvelApiConfig = new MarvelApiConfig.Builder(publicKey, privateKey).debug().build();

Once you have configured your Marvel api, you can use this object to obtain information from the Marvel Api.

Characters Api

CharacterApiClient contains all operations used to retrieve characters from the Marvel Api. If you want to perform complex queries you can use CharactersQuery object.

CharacterApiClient characterApiClient = new CharacterApiClient(marvelApiConfig);
CharactersQuery spider = CharactersQuery.Builder.create().withOffset(0).withLimit(10).build();
MarvelResponse<CharactersDto> all = characterApiClient.getAll(spider);

Comics Api

ComicApiClient contains all operations used to retrieve comics from the Marvel Api. If you want to perform complex queries you can use ComicsQuery object.

ComicApiClient comicApiClient = new ComicApiClient(marvelApiConfig);
ComicsQuery query = ComicsQuery.Builder.create().withOffset(0).withLimit(10).build();
MarvelResponse<ComicsDto> all = comicApiClient.getAll(query);

Series Api

SeriesApiClient contains all operations used to retrieve series from the Marvel Api. If you want to perform complex queries you can use SeriesQuery object.

SeriesApiClient seriesApiClient = new SeriesApiClient(marvelApiConfig);
SeriesQuery query = SeriesQuery.Builder.create().withOffset(0).withLimit(10).build();
MarvelResponse<SeriesCollectionDto> all = seriesApiClient.getAll(query);

Add it to your project

Include the library in your build.gradle

dependencies{
    compile 'com.karumi:marvelapiclient:1.0.1'
}

or to your pom.xml if you are using Maven

<dependency>
    <groupId>com.karumi</groupId>
    <artifactId>marvelapiclient</artifactId>
    <version>1.0.1</version>
    <type>jar</type>
</dependency>

Do you want to contribute?

Feel free to add any useful feature to the library, we will be glad to improve it with your help.

Keep in mind that your PRs must be validated by Travis-CI. Please, run a local build with ./gradlew checkstyle assemble test before submiting your code.

Libraries used in this project

License

Copyright 2015 Karumi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


Data provided by Marvel. © 2014 Marvel

marvelapiclientandroid's People

Contributors

flipper83 avatar jorgecastilloprz avatar lordraydenmk avatar pedrovgs avatar serchinastico avatar zygimantus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marvelapiclientandroid's Issues

Serialization

In my application I was trying to serialize the MarvelResponse object but I got this excepion:

Caused by: java.io.NotSerializableException: com.karumi.marvelapiclient.model.MarvelResponse
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at org.springframework.util.SerializationUtils.serialize(SerializationUtils.java:45)
... 36 more

What was the reason that this class does not implement Serializable?

Make models parcelable

It would be nice to have models to implement Parcelable, so they can be passed as arguments to intents.

MarvelApiClient synchronously calls

Hi guys! I've been reading your code specifically MarvelApiClient and I can't understand why the api calls are executed synchronously?, really I would like to understand the motivation.

¿Why you decided to do it this way?
How decide that the api calls should not be asynchronously?

What do you think about this mini famous disclaimer?

"synchronous requests can be the reason of app crashes on Android greater or equal than 4.0. You’re going to get aNetworkOnMainThreadExceptionerror".

Maybe if the api call was inside an IntentService it makes sense to me that's why I would like to know the motivation.

thank you for your awesome contributions are really cool!

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.