title: database is not created in android
body: <p>In my application activity was running fine but database is not getting created also there is no error in logcat.
  Main activity class:</p>
  
  <pre><code>package com.example.testdb;
  
  import android.os.Bundle;
  import android.app.Activity;
  import android.view.Menu;
  
  public class MainActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          Database d=new Database(this);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  }
  </code></pre>
  
  <p>Database class:</p>
  
  <pre><code>package com.example.testdb;
  
  import android.content.ContentValues;
  import android.content.Context;
  import android.database.Cursor;
  import android.database.sqlite.SQLiteDatabase;
  import android.database.sqlite.SQLiteDatabase.CursorFactory;
  import android.database.sqlite.SQLiteOpenHelper;
  import android.widget.Toast;
  
  public class Database extends SQLiteOpenHelper{
  
      String Tablename = "Table1";
      private String Column1 = "RegionID";
      private String Column2 = "RegionName";
      private String Column3 = "Currency";
      SQLiteDatabase db;
  
      public Database(Context context) {
          super(context, "Test", null, 2);
          this.getWritableDatabase();
          // TODO Auto-generated constructor stub
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
          // TODO Auto-generated method stub
          try {
              final String r_Table = "CREATE TABLE " + Tablename + " (" + Column1+ " INTEGER PRIMARY KEY , " + Column2 + " TEXT, " + Column3 + " Text) ";
              db.execSQL(r_Table);
              ContentValues cv = new ContentValues();
              cv.put(Column1, 1);
              cv.put(Column2, "India");
              cv.put(Column3, "Rupee");
              db.insert(r_Table, null, cv);
          }
          catch(Exception e){
              System.out.println(e.getMessage());
          }
  
          Cursor c = db.rawQuery("Select * from Table1", null);
  
          if (c != null ) {
              if  (c.moveToFirst()) {
                  //Toast.makeText(new MainActivity().getApplicationContext(), c.getCount(), Toast.LENGTH_LONG).show();
                  System.out.println("Rows are:"+c.getCount());
              }
          }
          c.close();  
      }
  
      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
          // TODO Auto-generated method stub
      }
  }
  </code></pre>
  
  <p>Logcat:</p>
  
  <pre><code>05-18 12:45:22.042: I/ActivityThread(3270): Switching default density from 160 to 130
  05-18 12:47:18.162: I/ActivityThread(3415): Switching default density from 160 to 130
  </code></pre>
  
  <p>I am using Virtual box for emulator and in DDMS I can't even see the database got created.</p>
  
  <p>Can anyone please help me in this.</p>
  
  <p>Thanks in advance
  Siva</p>