How can we add sms programatically in sim card in android -


I'm trying to use this content: // sms / sim URI but I just use the data base I can, but can not add to it. I really want to implement the 'copy to sim' functionality in my application.

This is my code snippet:

  ArrayList listName = new ArrayList (); ArrayList listContactId = new ArrayList (); Array list list mobile number = new arrivate (); ArrayList ListEmail = New Arrayist (); Uri Simuri = Uri.Parse ("Content: // SMS / SIM"); Cursor cursor = this.getContentResolver () Query (symmetry, empty, empty, empty, empty); String [] coloumnName = new string [cursorSim.getColumnCount ()]; (Int i = 0; i & lt; cursorSim.getColumnCount (); i ++) {coloumnName [i] = cursarum .getColumnName (i); Logs. I ("colman name ------- !!!!! ----------------", colonym [i]); } While adding (cursorSim.moveToNext ()) {listName (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 ("email"));  

This only allows me to read messages.

When I try to insert data.

  • Code snippet:

    // Enter the content value Price = New Content Price ();

    // values.put ("name", "one");

    values.put ("address", "1111111111"); Values.put ("body", "It's a great day. Thats expected because I was born"); Values.put ("Date", "1312434417006"); URI newRowUri = getContentResolver (). Insert (symmetry, value); 09-02 17: 35: 07.20 9: Error / SMS Provider (1476): Invalid Request: Content: // SMS / ICC

    I gave the necessary permissions in my manifest file Are there. Can someone suggest me how to do this? I also want to know whether this can be done or not, there are enough permissions for this too.

    Thank you Vaishnavi

    You can use regular APIs to read an SMS from the phone Can

      cursor cursor = context.gate content reseller (). Query (SMS_INBOX_CONTENT_URI, new string [] {"_id", "thread_id", "address", "person", "date", "body"}, WHERE_CONDITION, null, SORT_ORDER);   

    Now repeat through the cursor & amp; Receive messages

    You can use SmsContentProvider to save messages in another folder. (This is the SIM card)

      ContentValues ​​value = New content value (); Values.put ("address", "123456789"); Values.put ("body", "foo bar"); GetContentResolver () Insert (Uri.parse ("Content: // SMS / Sent"), value);             P>         div> 

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -