Phonebook Access Api Permissions - Motorola C370 Series Technical Manual

J2me developer guide
Hide thumbs Also See for C370 Series:
Table of Contents

Advertisement

Phonebook Access API Permissions

Prior to a MIDlet accessing the Phonebook API for all Phonebook operations, the
implementation will check the Phonebook permissions under the Java Settings Menu. The
phonebook permissions menu gives the user the following options:
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;
int categoryId = PhoneBookRecord.CATEGORY_GENERAL;
PhoneBookRecord phbkRec = new PhoneBookRecord(name, telNo, type,
categoryId);
Sample of code for calling of 'add(int sortOrder)' method:
int index = phbkRec.add(PhoneBookRecord.SORT_BY_NAME);
Sample of code for calling of 'update(int index, int sortOrder)' method:
phbkRec.type = PhoneBookRecord.HOME;
int newIndex = phbkRec.update(index, PhoneBookRecord.SORT_BY_NAME);
Sample of code for calling of 'delete(int index, int sortOrder)' method:
PhoneBookRecord.delete(index, PhoneBookRecord.SORT_BY_NAME);
Sample of code for calling of 'deleteAll()' method:
PhoneBookRecord.deleteAll();
Sample of code for calling of 'getRecord(int index, int sortOrder)' method:
phbkRec.getRecord(index, PhoneBookRecord.SORT_BY_NAME);
Sample of code for calling of 'findRecordByTelNo(String tel, int sortOrder)' method:
index = phbkRec.findRecordByTelNo(telNo, PhoneBookRecord.SORT_BY_NAME);
Always ask the user for authorization on all Phonebook access requests
Ask the user for authorization once per application (Default setting)
Never ask the user for authorization

Advertisement

Table of Contents
loading

This manual is also suitable for:

C450 seriesC550 series

Table of Contents