How can we add sms programatically in sim card in android
<p>I have been trying to do this using content://sms/sim URI. But i can just access the data base, but not add to it.  I actually want to implement 'copy to sim' functionality in my application.</p>

<p>This is my code snippet:</p>

<pre><code>     ArrayList listName=new ArrayList();
        ArrayList listContactId=new ArrayList();
        ArrayList listMobileNo=new ArrayList(); 
        ArrayList listEmail=new ArrayList();

        Uri simUri = Uri.parse("content://sms/sim");
        Cursor cursorSim    = this.getContentResolver().query(simUri, null, null,null, null);
        String[] coloumnName=new String[cursorSim.getColumnCount()];
        for(int i=0;i&lt;cursorSim.getColumnCount();i++)
{
        coloumnName[i]= cursorSim.getColumnName(i);
        Log.i("Coulmn name -------!!!!!----------------",coloumnName[i]);
}

         while (cursorSim.moveToNext()) {           
             listName.          add(cursorSim.getString(cursorSim.getColumnIndex("name")));
             listContactId.     add(cursorSim.getString(cursorSim.getColumnIndex("_id")));      
             listMobileNo.      add(cursorSim.getString(cursorSim.getColumnIndex("number")));
             listEmail.add(cursorSim.getString(cursorSim.getColumnIndex("emails")));
            }
</code></pre>

<p>This just allows me to read messages.</p>

<p>When i try to insert data.</p>

<ul>
<li><p><strong>Code snippet:</strong></p>

<p>//Insert
    ContentValues values = new ContentValues(); </p>

<p>// values.put("name", "One"); </p>

<p>values.put("address", "1111111111"); 
values.put("body", "Its a great day. Thats is been expected since i was born"); 
values.put("date", "1312434417006"); 
Uri newRowUri = getContentResolver().insert(simUri , values);
   09-02 17:35:07.209: ERROR/SmsProvider(1476): Invalid request: content://sms/icc</p></li>
</ul>

<p>I have given necessary permissions in my manifest file.
Can anyone suggest me how to do it. I even want to know whether this can be done, are there enough permissions to do this also.</p>

<p>Thanks
Vaishnavi</p>
