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 h
I created my own class to create tables and insert values in generatized manner.
public void createDynamicDatabase(Context context,String tableName,ArrayList title) {
Log.i("INSIDE createLoginDatabase() Method","*************creatLoginDatabase*********");
try {
int i;
String querryString;
myDataBase = context.openOrCreateDatabase("Db",Context.MODE_WORLD_WRITEABLE, null); //Opens database in writable mode.
//System.out.println("Table Name : "+tableName.get(0));
querryString = title.get(0)+" VARCHAR(30),";
Log.d("**createDynamicDatabase", "in oncreate");
for(i=1;i array_vals,ArrayList title,String TABLE_NAME) {
Log.d("Inside Insert","Insertion starts for table name: "+TABLE_NAME);
myDataBase = context.openOrCreateDatabase("Db",Context.MODE_WORLD_WRITEABLE, null); //Opens database in writable mode.
String titleString=null;
String markString= null;
int i;
titleString = title.get(0)+",";
markString = "?,";
Log.d("**createDynamicDatabase", "in oncreate");
for(i=1;i