I am making a program that intercepts the sms message coming in, compares the phone number to the contacts list and speaks the name of the person if it matches. (Its going to be a lesson for my students)
It works to a point. My wifes phone has started texting from 2 numbers, the usual (0271234567) and one with the international code prefix (64271234567). However the contacts list only triggers if the first number is received even when both are added to her contact details.
I notice other incoming texts do similar. Can it be stopped on the phone?
So I thought to strip out the incoming number to the last 7 digits, as they are common. However I have crashed on one line. Contact.phonenumber doesn't want to be chopped up.
Can anyone help? BTW I tried unsuccessfully to use MAP instead of list, so I commented it out, anyone know where I went wrong with Map? Hashtables are so much faster.
All code attached.
The Activity code is for testing purposes, the Service will be the final code.
Fixed . Updated with working copy
It works to a point. My wifes phone has started texting from 2 numbers, the usual (0271234567) and one with the international code prefix (64271234567). However the contacts list only triggers if the first number is received even when both are added to her contact details.
I notice other incoming texts do similar. Can it be stopped on the phone?
So I thought to strip out the incoming number to the last 7 digits, as they are common. However I have crashed on one line. Contact.phonenumber doesn't want to be chopped up.
Can anyone help? BTW I tried unsuccessfully to use MAP instead of list, so I commented it out, anyone know where I went wrong with Map? Hashtables are so much faster.
All code attached.
The Activity code is for testing purposes, the Service will be the final code.
Fixed . Updated with working copy
Attachments
Last edited: