fikr4n / SpiceAnnotations

Simple app showing how to use both AndroidAnnotations and RoboSpice with simple general request and lambda

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SpiceAnnotations

This is a simple app showing how to use both AndroidAnnotations and RoboSpice frameworks in one project with no complicated call nor declaration.

Create AndroidAnnotations REST client like this:

@Rest(rootUrl = "https://api.github.com/", converters = {...})
public interface RestClient {

    @Get("users/{username}")
    User getUser(@Path CharSequence username);

}

Do RoboSpice request like this:

    spiceManager.executeRequest(User.class, r -> r.getUser(username),
            username, // cache key
            DurationInMillis.ALWAYS_RETURNED, // cache duration
            this); // listener
    // or simply (no cache)
    spiceManager.executeRequest(User.class, r -> r.getUser(username), listener);

About

Simple app showing how to use both AndroidAnnotations and RoboSpice with simple general request and lambda


Languages

Language:Java 100.0%