title: Android automatically delete records after specific time
body: <p>I am creating an Android app in which i will receive SMS and store it in SQlite database. i have achieved database functionalities i.e insert, update, delete and show etc. Here is my code:</p>
  
  <pre><code>public void addRecord(String number){
      ContentValues values = new ContentValues();
      values.put(COLUMN_BLOCKEDLIST, number);
      SQLiteDatabase db = getWritableDatabase();
      db.insert(TABLE_BLOCKEDLIST, null,values);
      db.close();
  }
  
  //delete record from database
  public void deletRecord(String nummber){
      SQLiteDatabase db = getWritableDatabase();
      db.execSQL("DELETE FROM " + TABLE_BLOCKEDLIST + " WHERE " + COLUMN_BLOCKEDLIST + "=\"" + nummber + "\";");
      db.close();
  }
  
  //show all records from database
  
  public String showAllRecords(){
  String allRecords = "";
      SQLiteDatabase db = getWritableDatabase();
      String query = "SELECT * FROM " + TABLE_BLOCKEDLIST + " WHERE 1";
      Cursor cursor = db.rawQuery(query, null);
      cursor.moveToFirst();
      while (cursor.moveToNext()){
          allRecords += cursor.getString(0) + "\n";
      }
      db.close();
  return allRecords;
  }
  </code></pre>
  
  <p>now i need the functionally to delete every SMS after 24 hour of its insertion time. Any help will be appreciated. </p>