If you use a phone number for text or call, you can do this with only one line of code. Now it’s obvious that problems with the phone’s software can affect how the application accesses the PIM API. In addition, if the memory used in the settings for contacting the phone is installed on the SIM (alone), you cannot access the contacts in the phone’s memory and vice versa, make sure that both of them are used. Try it if you still have a problem,
//make a text field in LWUIT that is declared globally PhnNmbr = new TextField(); //set it to only accept phonenumber PhnNmbr.setConstraint(TextField.PHONENUMBER); //tell the user how to access phonebook PhnNmbr.setHint("Press T9 then 'Search' to search phonebook"); //add a button or command //that either sends an sms to //or calls the number in the text field //or anything else you want to do with it
When the user presses T9, the TextField is considered the LCDUI text field with the PHONENUMBER parameter, which allows him to search for contacts in the Sim and phone’s memory, so you will notice a search command (usually in the lower center). Also make sure that the memory used for the phone is installed on Phone and Sim.
source share