Hier bitte Schön, aber die Tabelle selbst bildet ja den String ab, Die tabelle wird ja aus dem String erzeugt, deswegen dachte ich da ist es besser zu sehen.
hier der String + zusaätzliche Zeilen
public class DataBaseHelper extends SQLiteOpenHelper
{
public static final String DATABASE_NAME = "database.db";
public static final String TABLE_NAME = "database_table";
public static final String COL1 = "_ID";
public static final String COL2 = "LEFTHANDPLAYERA"; //Button
public static final String COL3 = "LEFTHANDPLAYERB"; //Button
public static final String COL4 = "FILTER1"; //Spinner
public static final String COL5 = "FILTER2"; //Spinner
public static final String COL6 = "BALLSHOTLISTTABLE1PLAYERA"; //Spinner
public static final String COL7 = "BALLSHOTLISTTABLE1PLAYERB"; //Spinner
public static final String COL8 = "BALLSHOTLISTTABLE2PLAYERA"; //Spinner
public static final String COL9 = "BALLSHOTLISTTABLE2PLAYERB"; //Spinner
public static final String COL10 = "BALLSHOTLISTTABLE3PLAYERA"; //Spinner
public static final String COL11 = "BALLSHOTLISTTABLE3PLAYERB"; //Spinner
public static final String COL12 = "BALLSHOTLISTTABLE4PLAYERA"; //Spinner
public static final String COL13 = "BALLSHOTLISTTABLE4PLAYERB"; //Spinner
public static final String COL14 = "BALLSHOTLISTTABLE5PLAYERA"; //Spinner
public static final String COL15 = "BALLSHOTLISTTABLE5PLAYERB"; //Spinner
public static final String COL16 = "BALLSHOTLISTTABLE6PLAYERA"; //Spinner
public static final String COL17 = "BALLSHOTLISTTABLE6PLAYERB"; //Spinner
public static final String COL18 = "DESCRIPTION"; // Textbox
public static final String COL19 = "SHORTDESCRIPTION"; // Textbox
public static final String COL20 = "TRAJECTORYTABLE1"; //Seekbar
public static final String COL21 = "SIDESPINTABLE1"; //Seekbar
public static final String COL22 = "SPEEDTABLE1"; //Seekbar
public static final String COL23 = "BACKSPINTOPTABLE1"; //Seekbar
public static final String COL24 = "TRAJECTORYTABLE2"; //Seekbar
public static final String COL25 = "SIDESPINTABLE2"; //Seekbar
public static final String COL26 = "SPEEDTABLE2"; //Seekbar
public static final String COL27 = "BACKSPINTOPTABLE2"; //Seekbar
public static final String COL28 = "TRAJECTORYTABLE3"; //Seekbar
public static final String COL29 = "SIDESPINTABLE3"; //Seekbar
public static final String COL30 = "SPEEDTABLE3"; //Seekbar
public static final String COL31 = "BACKSPINTOPTABLE3"; //Seekbar
public static final String COL32 = "TRAJECTORYTABLE4"; //Seekbar
public static final String COL33 = "SIDESPINTABLE4"; //Seekbar
public static final String COL34 = "SPEEDTABLE4"; //Seekbar
public static final String COL35 = "BACKSPINTOPTABLE4"; //Seekbar
public static final String COL36 = "TRAJECTORYTABLE5"; //Seekbar
public static final String COL37 = "SIDESPINTABLE5"; //Seekbar
public static final String COL38 = "SPEEDTABLE5"; //Seekbar
public static final String COL39 = "BACKSPINTOPTABLE5"; //Seekbar
public static final String COL40 = "TRAJECTORYTABLE6"; //Seekbar
public static final String COL41 = "SIDESPINTABLE6"; //Seekbar
public static final String COL42 = "SPEEDTABLE6"; //Seekbar
public static final String COL43 = "BACKSPINTOPTABLE6"; //Seekbar
public static final String COL44 = "SHOTHEIGHT"; //Spinnner
public DataBaseHelper(Context context) {
super(context, DATABASE_NAME, null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
//private static final String createTable = "CREATE TABLE " + TABLE_NAME + " (" + ID + "INTEGER PRIMARY KEY AUTOINCREMENT, " + NAME1 + "TEXT, " + NAME2 + "TEXT);";
// String createTable = "CREATE TABLE " + TABLE_NAME + " (ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME1 TEXT, NAME2 TEXT, RB1 INTEGER)";
//String createTable = "CREATE TABLE " + TABLE_NAME + " (_ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME1 TEXT, NAME2 TEXT, RB1 TEXT, SP1 INTEGER, SB1 INTEGER)"; //funktioniert
// String createTable = "CREATE TABLE " + TABLE_NAME + " (_ID INTEGER PRIMARY KEY AUTOINCREMENT, LEFTHANDPLAYERA TEXT, LEFTHANDPLAYERB TEXT, FILTER1 INTEGER, FILTER2 INTEGER, " +
// " BALLSHOTLISTTABLE3PLAYERA INTEGER, BALLSHOTLISTTABLE3PLAYERB INTEGER, " +
// "BALLSHOTLISTTABLE4PLAYERA INTEGER, BALLSHOTLISTTABLE4PLAYERB INTEGER, BALLSHOTLISTTABLE5PLAYERA INTEGER, BALLSHOTLISTTABLE5PLAYERB INTEGER, BALLSHOTLISTTABLE6PLAYERA INTEGER, BALLSHOTLISTTABLE6PLAYERB INTEGER, " +
// "DESCRIPTION TEXT, SHORTDESCRIPTION TEXT, " +
// "TRAJECTORY1 INTEGER, SIDESPIN1 INTEGER, SPEED1 INTEGER, BACKSPINTOP1 INTEGER, TRAJECTORY2 INTEGER, SIDESPIN2 INTEGER, SPEED2 INTEGER, BACKSPINTOP2 INTEGER, " +
// "TRAJECTORY3 INTEGER, SIDESPIN3 INTEGER, SPEED3 INTEGER, BACKSPINTOP1 INTEGER, TRAJECTORY4 INTEGER, SIDESPIN4 INTEGER, SPEED4 INTEGER, BACKSPINTOP4 INTEGER, " +
// "TRAJECTORY5 INTEGER, SIDESPIN5 INTEGER, SPEED5 INTEGER, BACKSPINTOP5 INTEGER, TRAJECTORY6 INTEGER, SIDESPIN6 INTEGER, SPEED6 INTEGER, BACKSPINTOP6 INTEGER, " +
// "SHOTHEIGHT INTEGER)";
StringBuilder sb = new StringBuilder();
sb.append("CREATE TABLE ");
sb.append(TABLE_NAME);
sb.append(" (_ID INTEGER PRIMARY KEY AUTOINCREMENT, ");
sb.append("LEFTHANDPLAYERA TEXT, LEFTHANDPLAYERB TEXT, FILTER1 INTEGER, FILTER2 INTEGER, ");
sb.append("BALLSHOTLISTTABLE1PLAYERA INTEGER, BALLSHOTLISTTABLE1PLAYERB INTEGER, BALLSHOTLISTTABLE2PLAYERA INTEGER, BALLSHOTLISTTABLE2PLAYERB INTEGER, ");
sb.append("BALLSHOTLISTTABLE3PLAYERA INTEGER, BALLSHOTLISTTABLE3PLAYERB INTEGER, BALLSHOTLISTTABLE4PLAYERA INTEGER, BALLSHOTLISTTABLE4PLAYERB INTEGER, ");
sb.append("BALLSHOTLISTTABLE5PLAYERA INTEGER, BALLSHOTLISTTABLE5PLAYERB INTEGER, BALLSHOTLISTTABLE6PLAYERA INTEGER, BALLSHOTLISTTABLE6PLAYERB INTEGER, ");
sb.append("DESCRIPTION TEXT, SHORTDESCRIPTION TEXT, ");
sb.append("TRAJECTORY1 INTEGER, SIDESPIN1 INTEGER, SPEED1 INTEGER, BACKSPINTOP1 INTEGER, TRAJECTORY2 INTEGER, SIDESPIN2 INTEGER, SPEED2 INTEGER, BACKSPINTOP2 INTEGER, ");
sb.append("TRAJECTORY3 INTEGER, SIDESPIN3 INTEGER, SPEED3 INTEGER, BACKSPINTOP3 INTEGER, TRAJECTORY4 INTEGER, SIDESPIN4 INTEGER, SPEED4 INTEGER, BACKSPINTOP4 INTEGER, ");
sb.append("TRAJECTORY5 INTEGER, SIDESPIN5 INTEGER, SPEED5 INTEGER, BACKSPINTOP5 INTEGER, TRAJECTORY6 INTEGER, SIDESPIN6 INTEGER, SPEED6 INTEGER, BACKSPINTOP6 INTEGER, ");
sb.append("SHOTHEIGHT INTEGER )");
//db.execSQL(createTable);
db.execSQL(sb.toString());
// String createTable = "CREATE TABLE " + TABLE_NAME + "(" + COL1 + " INTEGER PRIMARY KEY AUTOINCREMENT," + COL2 + " TEXT," + COL3 + " TEXT," + COL4 + " TEXT" + ")"; // ein anderer Weg für die String definition
}
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
{
db.execSQL("DROP IF TABLE EXISTS" + TABLE_NAME);
onCreate(db);
}
// das ist für save Data
//public boolean addData(String name1, String name2, Integer rb1) //+ String id > könnte eine ID
public boolean addData(String LeftHandPlA, String LeftHandPlB, Integer Filter1, Integer Filter2,
Integer BallShotTable1A, Integer BallShotTable1B, Integer BallShotTable2A, Integer BallShotTable2B , Integer BallShotTable3A, Integer BallShotTable3B,
Integer BallShotTable4A, Integer BallShotTable4B, Integer BallShotTable5A, Integer BallShotTable5B , Integer BallShotTable6A, Integer BallShotTable6B,
String Description, String ShortDescription,
Integer Trajectory1, Integer SideSpin1, Integer Speed1, Integer BackSpinTop1,Integer Trajectory2, Integer SideSpin2, Integer Speed2, Integer BackSpinTop2,
Integer Trajectory3, Integer SideSpin3, Integer Speed3, Integer BackSpinTop3,Integer Trajectory4, Integer SideSpin4, Integer Speed4, Integer BackSpinTop4,
Integer Trajectory5, Integer SideSpin5, Integer Speed5, Integer BackSpinTop5,Integer Trajectory6, Integer SideSpin6, Integer Speed6, Integer BackSpinTop6, Integer ShotHeight)
// public boolean addData(String LeftHandPlA, String LeftHandPlB, Integer Filter1, Integer Filter2,
// Integer BallShotTable1A, Integer BallShotTable1B, Integer BallShotTable2A, Integer BallShotTable2B, Integer BallShotTable3A, Integer BallShotTable3B,
// Integer BallShotTable4A, Integer BallShotTable4B, Integer BallShotTable5A, Integer BallShotTable5B, Integer BallShotTable6A, Integer BallShotTable6B,
// String Description, String ShortDescription)
Alles anzeigen