SMSManager and Country code prefix
<p>I am coding a prog about SMS,i have a service,and a broadcast receiver,when a sms is sent,i get the "displayoriginatingadress,then its automaticly Resend another sms to the source number,but i have a bug/force close for Invalid Destination Address beacause when i get the source number(i am from france) its like this : "+33617890922" but i need to get it like this "0617890922",how can i do it ?
** Any Help????</p>

<pre><code>public void onReceive(Context c, Intent intent) {
    // TODO Auto-generated method stub


 mContext = c;




          Bundle pudsBundle = intent.getExtras();

             Object[] pdus = (Object[]) pudsBundle.get("pdus");
             SmsMessage messages =SmsMessage.createFromPdu((byte[]) pdus[0]);    

             Toast.makeText(c, "Service SMS Started OK !", Toast.LENGTH_LONG).show();
             Toast.makeText(c, "SMS Received : "+messages.getMessageBody(),
             Toast.LENGTH_LONG).show();
             String str = messages.getMessageBody();
             String num = messages.getDisplayOriginatingAddress();

         String str1= PhoneNumberUtils.formatNanpNumber(num);
 if(messages.getMessageBody().contentEquals("klmj")){

                 if (intent.getAction().equals(ACTION_RECEIVE_SMS)){







                    Intent serviceIntent = new Intent(mContext, ServiceLocation.class);
                    serviceIntent.putExtra("id", str1);


                    mContext.startService(serviceIntent);
             }
</code></pre>

<p>.... .... .... ....</p>

<hr>

<p>ok the problem is not from "+33" beacause i tried to replace the destinationadress to send sms by "+33677890098" and its work,im lost,it is the data i get from my broadcast receiver are corrupted?? here some code Also i dunno how to use an external library that i have found called "phoneutil" i think,is my problem come from my received number from my intent? i tried to put quote with no luck,also same problem using some String operation... wtf please help thanks you</p>

<p>UPDATE: i noticed that the String "str" is Empty when used in the "lo" method,see code modification below :</p>

<pre><code>public class ServiceTe extends Service{
private final String ACTION_RECEIVE_SMS =  "android.provider.Telephony.SMS_RECEIVED";  
private String initData;
int myLatitude , myLongitude;
private String loc;
private String str;
private String num;
public void onCreate(){

lo();


}
public int onStartCommand(Intent itn, int num1, int flag){

 str = itn.getStringExtra("id");
 Toast.makeText(this, "One !" +str, Toast.LENGTH_LONG).show();



return 0;
}

public void lo(){
    // TODO Auto-generated method stub



     Toast.makeText(this, "Two !", Toast.LENGTH_LONG).show();
     TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
     GsmCellLocation cellLocation = (GsmCellLocation) telephonyManager.getCellLocation();

        //This Toast show : "" , Nothing...

    Toast.makeText(this, str, Toast.LENGTH_LONG).show();

        int cid = cellLocation.getCid();
        int lac = cellLocation.getLac();

        if(RqsLocation(cid, lac)){


      loc = (
              String.valueOf((float)myLatitude/1000000)
              + " : "
              + String.valueOf((float)myLongitude/1000000));
    Its doesnt work like this,Force Close , and invalid DestinationAddress error
    SmsManager.getDefault().sendTextMessage(str OR this :        itn.getStringExtra("id"); , null, loc, null, null);

        }else{ Its work like this !
            SmsManager.getDefault().sendTextMessage("+33643598356", null, "Cant Report Location", null, null);
        };
</code></pre>
