Getting conversations

Let's start by adding an endpoint to get all of the conversations on the phone, as follows:

    public Response getConversations() { 
      List<Conversation> conversations = new ArrayList<>(); 
      Cursor cur = getApplication().getContentResolver() 
      null, null, null, null); 
      while (cur.moveToNext()) { 
      Collections.sort(conversations, new ConversationComparator()); 
      return Response.ok(new GenericEntity<List<Conversation>>( 
      conversations) {}).build(); 

Here is where we see the Android artifacts start to show up--we are going to use a ContentProvider to access the SMS data. A ContentProvider is a way for an application, ...

Get Java 9: Building Robust Modular Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.