uk.co.silentsoftware.datastore
Class PIMAccessor

java.lang.Object
  extended by 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.


Constructor Summary
PIMAccessor()
           
 
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
 

Constructor Detail

PIMAccessor

public PIMAccessor()
Method Detail

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.