uk.co.silentsoftware.datastore
Class PIMAccessor
java.lang.Object
uk.co.silentsoftware.datastore.PIMAccessor
public class PIMAccessor
- extends java.lang.Object
Class to access PIM information
Note this class is an awful hack to
circumvent multiple accesses to the PIM
which would cause security dialogs each
time, instead the data is loaded once
on startup.
The intention of the class is to copy all
contacts (yes ALL contacts - memory issues
could surface...) to a local Vector and
find the contact in it rather than resorting
to a PIM contact list call. Unfortunately
there also isn't a nice API way of removing
international and national dialling codes
and comparing it to the numbers in the Contacts
(which may also be national or international)
- so the code substrings the searched for number
of the first 3 chars to see if any Contact data
contains the remaining digits.
|
Method Summary |
static java.lang.String |
findNameInList(java.lang.String number)
Finds a telephone number in the PIM data
and returns the formal name |
static void |
loadNames()
Initialises the PIM data in this class so future
retrievals (and thus security alerts) are not needed. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PIMAccessor
public PIMAccessor()
findNameInList
public static java.lang.String findNameInList(java.lang.String number)
- Finds a telephone number in the PIM data
and returns the formal name
- Parameters:
number -
- Returns:
loadNames
public static void loadNames()
- Initialises the PIM data in this class so future
retrievals (and thus security alerts) are not needed.