Code example for ContentValues

Methods: insertput

    // insert a message into the sms/mms provider. 
    // we do this in the case of outgoing messages 
    // that were not sent via this phone, and also on initial 
    // message sync. 
    void insertMessage(String number, String text, int type, long date) {
        ContentValues values = new ContentValues();
        values.put("address", number);
        values.put("body", text);
        values.put("type", type);
        values.put("date", date);
        values.put("read", 1);
        getContentResolver().insert(Uri.parse("content://sms/sent"), values);
    // refresh the messages that were on the server 
    void refreshMessages() { 
        String account = settings.getString("account", null);
        if (account == null)
        try {