Problems with DataBase Android
<p>I have a big problem with my Database.</p>

<p>This is the code I used to have to create the DataBase:</p>

<pre><code>public static void initDatabase(Context context){
    db = context.openOrCreateDatabase(DATABASE_NAME, SQLiteDatabase.OPEN_READWRITE, null);
    db.execSQL("CREATE TABLE IF NOT EXISTS " +
            TABLE_NAME + " (number TEXT, name TEXT);");
    db.close();
    Log.i(TAG, "Database opened ok"); 
}
</code></pre>

<p>The problem is that now, I need to add a new table with new information.
If I create a new table the same way, I have problems with my application cause when it try to access the DataBase, it breaks.</p>

<p>Can anyone help me?? I don´t know very well how to make correctly the database in Android.</p>

<p>EDITED:</p>

<p>This is the code of the new table....</p>

<pre><code>public static void initDatabase(Context context){
db = context.openOrCreateDatabase(DATABASE_NAME, SQLiteDatabase.OPEN_READWRITE, null);
db.execSQL("CREATE TABLE IF NOT EXISTS " +
        TABLE_NAME + " (tlf TEXT, name TEXT);");
db.close();
Log.i(TAG, "Database opened ok"); 
</code></pre>

<p>}</p>

<p>This is why i didn´t added it before, cause it is another table which is almost the same as the other one....</p>

<p>EDITED AND SOLVED:</p>

<p>Finally i was following one tutorial where it speaks about using the class "SQLiteOpenHelper" where u can alter the tables and the DataBase. </p>

<p>Thanks anyway to everyone!</p>
