title: Android SQLite database is not created
body: <p>The <code>SQLite database</code> is not created. I am playing with this for the past few hours but now i got tired a lot. I am not getting any errors or warnings in the <code>Log Cat</code>. Here is my code what I have tried so far. Help will be appreciated.</p>
  
  <pre><code>public class MySQLiteHelper extends SQLiteOpenHelper{
      final static String DB_NAME = "citiesdata.db";
      final static String TABLE_NAME = "allcities";
      final static String ID = "_id";
      final static String CITY_CODE = "city_code";
      final static int DB_VERSION = 1;
      private SQLiteDatabase db;
      Context cont;
  
      public MySQLiteHelper(Context context) {
          super(context, DB_NAME, null, DB_VERSION);
          cont = context;
          Toast.makeText(cont, "constructor called", Toast.LENGTH_LONG).show();
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
          Toast.makeText(cont, "onCreate method called", Toast.LENGTH_LONG).show();
          String createTable = "CREATE TABLE IF NOT EXISTS " + TABLE_NAME + "(" + ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + CITY_CODE + " TEXT);";
          db.execSQL(createTable);
  
  //      INSERTING RECORDS IN DATABASE
          SQLiteDatabase writableDB = this.getWritableDatabase();
          ContentValues values = new ContentValues();
          values.put(CITY_CODE, "333");
          writableDB.insert(TABLE_NAME, null, values);
          writableDB.close();
          readCity();
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
          Toast.makeText(cont, "onUpgrade method called", Toast.LENGTH_LONG).show();
          db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
          onCreate(db);
      }
  
  
      public void readCity(){
          Toast.makeText(cont, "readCity method called", Toast.LENGTH_LONG).show();
          String selectQuery = "SELECT  * FROM " + TABLE_NAME;
          SQLiteDatabase db = this.getReadableDatabase();
          Cursor cursor = db.rawQuery(selectQuery, null);
          Toast.makeText(cont, cursor.getString(cursor.getColumnIndex(CITY_CODE)), Toast.LENGTH_LONG).show();
          db.close();
      }
  }
  </code></pre>
  
  <p>Calling the Constructor in the main UI Thread on a button click like this.</p>
  
  <pre><code>new MySQLiteHelper(MainActivity.this);
  </code></pre>
  
  <p>Permissions are...</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE"/&gt;
  </code></pre>
  
  <p>Thanks a lot in advance.</p>