Motorola HANDSET C381P User Manual
Page 51
11
Phonebook Access API
51
Sample of code for calling of ‘getNumberRecords(int device)’ method:
// get total number of records
int numberRecsInPhone =
PhoneBookRecord.getNumberRecords(PhoneBookRecord.PHONE_MEMORY);
int numberRecsInSim =
PhoneBookRecord.getNumberRecords(PhoneBookRecord.SIM_MEMORY);
int numberRecsAll =
PhoneBookRecord.getNumberRecords(PhoneBookRecord.ALL_MEMORY);
Sample of code for calling of ‘getAvailableRecords(int device)’ method:
// get number of available records
int numberRecsAvalPhone =
PhoneBookRecord.getAvailableRecords(PhoneBookRecord.PHONE_MEMORY);
int numberRecsAvalSim =
PhoneBookRecord.getAvailableRecords(PhoneBookRecord.SIM_MEMORY);
int numberRecsAvalAll =
PhoneBookRecord.getAvailableRecords(PhoneBookRecord.ALL_MEMORY);
Sample of code for calling of ‘getUsedRecords(int device, int sortOrder)’ method:
// get number of used records
int numberRecsUsedPhone =
PhoneBookRecord.getUsedRecords(PhoneBookRecord.PHONE_MEMORY,
PhoneBookRecord.SORT_BY_NAME);
int numberRecsUsedSim =
PhoneBookRecord.getUsedRecords(PhoneBookRecord.SIM_MEMORY,
PhoneBookRecord.SORT_BY_NAME);
int numberRecsUsedAll =
PhoneBookRecord.getUsedRecords(PhoneBookRecord.ALL_MEMORY,
PhoneBookRecord.SORT_BY_NAME);
Sample of code for calling of ‘getNumberRecordsByName(String name)’ method:
int num = PhoneBookRecord.getNumberRecordsByName(name);
Sample of code for calling of ‘getMaxNameLength(int device)’ method:
int maxNameLengthPhone =
PhoneBookRecord.getMaxNameLength(PhoneBookRecord.PHONE_MEMORY);
int maxNameLengthSim =
PhoneBookRecord.getMaxNameLength(PhoneBookRecord.SIM_MEMORY);
int maxNameLengthAll =
PhoneBookRecord.getMaxNameLength(PhoneBookRecord.ALL_MEMORY);
Sample of code for calling of ‘getMaxTelNoLength (int device)’ method:
int maxTelNoLengthPhone =
PhoneBookRecord.getMaxTelNoLength(PhoneBookRecord.PHONE_MEMORY);