Implementing view contacts services
In this recipe, we are going to see how to implement view contacts services for our Android app.
Getting ready…
To get started with this recipe, you should have performed the earlier recipes.
How to do it…
Let's implement view contacts services:
- To fetch the contacts saved by a particular user, we will use the same
AppContact
model that we used in the earlier recipe. - Next, we need to write a method that fetches all the contacts saved with a certain e-mail ID:
public static List<AppContact> getAllContacts(String email) { AmazonDynamoDBClient ddb = ContactListActivity.clientManager.ddb(); DynamoDBMapper mapper = new DynamoDBMapper(ddb); List<AppContact> contactList = new ArrayList<AppContact>(); try { Log.d(TAG, "Fetching contacts"); // Condition to get records for given userEmailId Condition condition = new Condition().withComparisonOperator( ComparisonOperator.EQ.toString()...