title: Adding data into SQLite database from another class in android
body: <p>I am trying to add a simple int count which is set to count++ everytime a player wins it will increment by 1. I am trying to add this int count inside my SQLite Database. But I have no Idea how I can do that, the database is in one class, and my int value is in another class, How can I add the int inside the database. I have created a addScores method inside my class:</p>
  
  <p>Database Code:</p>
  
  <pre><code>public class Database {
  
  public static final String KEY_ROWID = "_id"; 
  public static final String KEY_NAME = "number_of_wins"; 
  
  private static final String DATABASE_NAME = "HIGHSCORES"; 
  private static final String DATABASE_TABLE= "Total_Wins"; 
  private static final int DATABASE_VERSION = 2;
  
  private DBHelper ourHelper;
  private final Context ourContext;
  private SQLiteDatabase ourDatabase;
  
    private static class DBHelper extends SQLiteOpenHelper {
  
      public DBHelper(Context context) {
          super(context, DATABASE_NAME, null, DATABASE_VERSION);
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
           db.execSQL("CREATE TABLE " + DATABASE_TABLE + " (" +
                      KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                      KEY_NAME + " INTEGER);"
                      );
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
          db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE);
          onCreate(db);
      }
  
  }
  public Database(Context context) {
      ourContext = context;
  }
  
  public Database open() {
      ourHelper = new DBHelper(ourContext);
      ourDatabase = ourHelper.getWritableDatabase();
      return this;
  }
  
  public void close() {
      ourHelper.close();
  }
  
  public Cursor getScores() {
      return ourDatabase.rawQuery("SELECT * FROM "+DATABASE_TABLE, null); //No Parameter
  }
  }
  </code></pre>
  
  <p>Someother Class:</p>
  
  <pre><code>int count =0;
  count++;
  //Adding HighScore to Database
          public void addScore() {
  
          }
  </code></pre>
  
  <p>How do I add the int count inside my database? I am trying to add it in the column number_of_wins?</p>