using existing database for creating table in sqlite
<p>I have a database called first.db created in a app called Player1. I want to use same database to create another table from different app called Player2. I am also providing same "sharedUserId" from Player1 to player2. But when i try to create table in app "Player2", it does not go to onCreate method for table. </p>

<pre><code>    public static final String KEY_ID="_id";
public static final String KEY_ClIENTID="_clientid";
public static final String KEY_LOCATION="_location";
public static final String KEY_MASTERDIRECTOR="_masterdirector";
public static final String KEY_IPADDRESS="_ipaddress";
public static final String KEY_SUBNETMASK="_subnetmask";
public static final String DATABASE_TABLE ="preptool";

private static final String DB_NAME = "first.db";
private static final int DB_VERSION = 1;

private DbHelper ourhelper;
private Context context;
private SQLiteDatabase ourdatabase; 

public dataBase(Context sharedContext){
    context = sharedContext; 
}
public class DbHelper extends SQLiteOpenHelper{

    public DbHelper(Context c) {
        super(c, DB_NAME, null, DB_VERSION); 
    }
    @Override
    public void onCreate(SQLiteDatabase db) { 
        System.out.println("in");
        try{
        db.execSQL("CREATE TABLE " + DATABASE_TABLE + " ("  +
                KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " +
                KEY_ClIENTID + " TEXT NOT NULL, " +
                KEY_LOCATION + " TEXT NOT NULL, " +
                KEY_MASTERDIRECTOR + " TEXT NOT NULL, " +
                KEY_IPADDRESS + " TEXT NOT NULL, " +                    
                KEY_SUBNETMASK + " TEXT NOT NULL);");  
        }catch(Exception e){
        }
    }
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL("DROP TABLE IF EXISTS" + DATABASE_TABLE ); 
        onCreate(db);
    }
}
public dataBase open()throws SQLException{
    ourhelper = new DbHelper(context);  System.out.println(context);
    ourdatabase = ourhelper.getWritableDatabase(); 
    return this;
}
public void close(){
    ourhelper.close();
}
</code></pre>

<p>The code below i am writing in my Player2 application to accesss the database from Player1 app:</p>

<pre><code>     Context sharedContext = null;
    try {
          sharedContext =     this.createPackageContext("com.xxx.android.player1",Context.CONTEXT_INCLUDE_CODE);
          if (sharedContext == null) {
                return;
          }
    } catch (NameNotFoundException e1) {
    }

    db = new dataBase(sharedContext);
    db.open(); 
</code></pre>
