title: Is it possible to Create sqlite table at run time based on number of elements in array
body: <p>I have a different arraylist with column names. I want to have a generatized create method that should create table based on the arraylist i have passed. Is it possible to have a structure with can create table dynamically. Please suggest any solution.</p>
  
  <pre><code>private static class OpenHelper extends SQLiteOpenHelper {
  
          OpenHelper(Context context) {
          super(context, DATABASE_NAME, null, DATABASE_VERSION);
          System.out.println("openhelper1");
  
      }
  
      @Override
      public void onCreate(SQLiteDatabase db) {
          Log.d("**DataHelper", "***********in oncreate");
          db.execSQL("CREATE TABLE " + TABLE_NAME + " (username TEXT,altnum TEXT,passkey TEXT,flag TEXT)");
  
      }
  
  
      @Override
      public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
          Log.w("Example", "Upgrading database, this will drop tables and recreate.");
          db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
          onCreate(db);
      }
  }
  </code></pre>