I am trying to learn to use SQL with android. I tried to save data in one column from editText field. Though I followed some tutorial and studied And.Developers page, my apps crashes each time I try to save record (when I hit button). Could you tell me what I am doing wrong? Code below.. Any help would be most appreciated.

Main Activity

```
public class MainActivity extends AppCompatActivity {

    EditText editText;
    Button button;
    Context context;
    SQLiteDatabase sqLiteDatabase;
    DbHelper dbHelper;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        editText = (EditText) findViewById(R.id.editText);
        button = (Button) findViewById(R.id.button);

    }

    public void ulozit (View view){
        String darek = editText.getText().toString();
        dbHelper = new DbHelper(context);
        sqLiteDatabase = dbHelper.getWritableDatabase();
        dbHelper.addInformation(darek, sqLiteDatabase);
        Toast.makeText(getBaseContext(), "Tadáá", Toast.LENGTH_LONG).show();
        dbHelper.close();
    } 
}

```

---

Class with layout of table

```
public  class contract { 

    public static abstract class rozvrzeni_tabulky {

        public static final String DAREK = "Dárek";
        public static final String TABLE_NAME = "vstupy";
    }
}

```

---

DB Class

```
public class DbHelper extends SQLiteOpenHelper {

    private static final String JMENO_DATABAZE = "Databáze";
    private static final int VERZE_DATABAZE = 1;
    private static final String VYTVOR_DOTAZ = "CREATE TABLE "+contract.rozvrzeni_tabulky.TABLE_NAME+"("+contract.rozvrzeni_tabulky.DAREK+" TEXT);";

    public DbHelper (Context context){
        super(context,JMENO_DATABAZE,null,VERZE_DATABAZE); //konstruktor k vytvoření databáíze
    }

    @Override
    public void onCreate(SQLiteDatabase db) {

        db.execSQL(VYTVOR_DOTAZ);
    }

    public void addInformation (String darek, SQLiteDatabase db){

        ContentValues contentValues = new ContentValues();
        contentValues.put(contract.rozvrzeni_tabulky.DAREK,darek);
        db.insert(JMENO_DATABAZE,null,contentValues);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}

```