How can I get the destination address from a sms(so that I will have the mobile number of my device) when I receive a new sms in my BroadcastReceiver?
the code:
TelephonyManager tMgr = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
String myPhoneNumber = tMgr.getLine1Number();
will not work since the getLine1Number() method in TelephonyManager retrieves the data in the "phone number" stored on the SIM card (NOT the phone number bound to the user's account) - this is often either wrong or non-existent, depending on the network provider it was shipped from.
I already also checked the SMSMessage Class and I couldn't find any method helping me.