I'm developing an Android app for a WordPress site. I'm using XMLRPC to fetch posts from the server and list them in the app.
Since the XMLRPC client I use for Android enables me to call the WordPress' methods and handle the result, I'm completely dependent on the methods available in WordPress' class-wp-xmlrpc-server.php file.
So far, I used wp.getPosts() method from the WordPress XMLRPC API, and I successfully fetched the most recent posts, like so:
Object[] params = {1, username, password}; // parameters for wp.getPosts(), blogID (1), username and password.
XMLRPCClient client = new XMLRPCClient(url, username, password);
Object[] posts = client.call("wp.getPosts", params);
The problem: I want to be able to get recent posts but from ONE category only, not from the entire website (all categories) like it did above. I've searched through [WordPress XMLRPC API documentation][3] and I couldn't find any parameter that I could pass to wp.getPosts() that would allow me to retrieve posts only from one specific category.
I feel like there is a simple solution to this, but I seem to miss it.
You'll create a plugin that implements a custom function as shown in Custom XML-RPC Methods in WordPress and install it on the target site.
The following is a test file in PHP (I don't know Java):