I need to compare two phone numbers to determine if they\'re from the same sender/receiver. The user may send a message to a contact, and that contact may reply.
The
Android has nice PhoneNumberUtils, and i guess your looking for :
public static boolean compare (String a, String b)
look in : http://developer.android.com/reference/android/telephony/PhoneNumberUtils.html
using it should look like this :
String phone1
String phone2
if (PhoneNumberUtils.compare(phone1, phone2)) {
//they are the same do whatever you want!
}