I used Retrofit Library to connect the android app with WordPress site(json api) its a news app.
I get displayed the categories,but how can i get the posts from one specific category ?
Here is my API interface :

public interface API {

/* your wordPress url */
String BASE_URL = "http://jollymagazine.com/";


// minimize field for list of post
String EXCLUDE_FIELD = "&exclude=content,categories,tags,comments,custom_fields";

/* info API transaction ------------------------------- */

@GET("?json=info")
Call<CallbackInfo> getInfo();


/* Post API transaction ------------------------------- */

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@GET("?json=get_posts" + EXCLUDE_FIELD)
Call<CallbackListPost> getPostByPage(
        @Query("page") int page,
        @Query("count") int count
);

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@GET("?json=get_post")
Call<CallbackDetailsPost> getPostDetialsById(
        @Query("id") int id
);

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@GET("?json=get_search_results" + EXCLUDE_FIELD)
Call<CallbackListPost> getSearchPosts(
        @Query("search") String search,
        @Query("count") int count
);


/* Category API transaction --------------------------- */

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@GET("?json=get_category_index")
Call<CallbackCategories> getAllCategories();

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@GET("?json=get_category_posts" + EXCLUDE_FIELD)
Call<CallbackCategoryDetails>getCategoryDetailsByPage (
        @Query("id") int id,
        @Query("page") int page,
        @Query("count") int count
);


@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@GET("?json=respond/submit_comment")
Call<CallbackComment> sendComment(
        @Query("post_id") long post_id,
        @Query("name") String name,
        @Query("email") String email,
        @Query("content") String content
);

@Headers({"Cache-Control: max-age=0", "User-Agent: WordPress"})
@POST("?api-fcm=register")
Call<CallbackDevice> registerDevice(@Body DeviceInfo deviceInfo);

}

Read more here: Get posts from specific category. (WordPress Json Api ) (Retrofit)


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: