Motorola E680 Technical Manual - Page 61
where the MIDlet falls in. For an untrusted MIDlet, the permission for the API is Oneshot.
View all Motorola E680 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 61 highlights
15 Phonebook Access API In the Motorola E680, Phonebook API permissions have been added to the MIDP 2.0 security framework "com.motorola.phonebook." The behavior is up to the domain setting where the MIDlet falls in. For an untrusted MIDlet, the permission for the API is "Oneshot". The following are code samples to show implementation of the Phonebook API: Sample of code to create object of PhoneBookRecord class: PhoneBookRecord phbkRecEmpty = new PhoneBookRecord(); String name = "Name"; String telNo = "9999999"; int type = PhoneBookRecord.MAIN; PhoneBookRecord phbkRec = new PhoneBookRecord(name, telNo, type); Sample of code for calling of 'add()' method: int index = phbkRec.add(); Sample of code for calling of 'update(int index)' method: phbkRec.type = PhoneBookRecord.HOME; int newIndex = phbkRec.update(index); Sample of code for calling of 'delete(int index)' method: PhoneBookRecord.delete(index); Sample of code for calling of 'deleteAll()' method: PhoneBookRecord.deleteAll(); Sample of code for calling of 'getRecord(int index)' method: phbkRec.getRecord(index); Sample of code for calling of 'findRecordByTelNo(String tel)' method: index = phbkRec.findRecordByTelNo(telNo); Sample of code for calling of 'findRecordByName(char firstChar)' method: index = PhoneBookRecord.findRecordByName('N'); Sample of code for calling of 'findRecordByEmail(String email)' method: String email = "[email protected]"; index = phbkRec.findRecordByEmail(email); Sample of code for calling of 'getNumberRecords(int device)' method: 61