sqlite insert or replace code example
Example: android sqlite insert or replace
SQLiteDatabase db=this.getWritableDatabase();
ContentValues cv=new ContentValues();
cv.put("columName1",YOUR_VAR);
cv.put("columName2",YOUR_VAR);
cv.put("columName3",YOUR_VAR);
int response=db.update("YourTable",cv,"columName = ?"+ new String[]{YOUR_VAR})
if(response==0){
db.insert("Your_table",null,cv);
}