July 2017
Intermediate to advanced
466 pages
11h 24m
English
Let's start by adding an endpoint to get all of the conversations on the phone, as follows:
@GET
@Path("conversations")
public Response getConversations() {
List<Conversation> conversations = new ArrayList<>();
Cursor cur = getApplication().getContentResolver()
.query(Telephony.Sms.Conversations.CONTENT_URI,
null, null, null, null);
while (cur.moveToNext()) {
conversations.add(buildConversation(cur));
}
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, ...
Read now
Unlock full access