Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJosh Gold
12,207 PointsWe need to set up an API client (Google Play Services) Task 1 of 4
In Google Play Services task 1 of 4 for the section Set up an API Client, I get the error "You need to create an interface named 'Api'
Here is my code:
import com.joshbgold.recommendations.model.ActiveListings;
import retrofit.Callback;
import retrofit.http.GET;
import retrofit.http.Query;
public class Api {
@GET("/listings/active")
void activeListings(@Query("includes") String includes,
Callback<ActiveListings> callback) {
}
}
1 Answer
Pablo Rocha
10,142 Pointsfor task 1 make sure you define an interface not a class
public interface Api {
}
Josh Gold
12,207 PointsJosh Gold
12,207 PointsAha! Thanks Pablo I was thinking way too much. The challenge only wants the interface defined in the first step, but the interface doesn't have to do anything yet.
Pablo Rocha
10,142 PointsPablo Rocha
10,142 PointsHi Josh - Glad to help, let us know if you need help with the other tasks.
Yvonne Mutangi
4,618 PointsYvonne Mutangi
4,618 Pointscan you help me with task 3