ERROR Android Studio SQLite table "inventory" has no column named "quantity"

I know its simple and I am just new to SQLite and Android Studio, but I am trying to create a database table inventory each item having an ID, item name, and quantity. Then view that database table in RecyclerView. Right now I am getting the error message: E/SQLiteDatabase: Error inserting item=Apples _id=1 quantity=5 android.database.sqlite.SQLiteException:… Read More ERROR Android Studio SQLite table "inventory" has no column named "quantity"

Android – try with resources just for creating database tables

In Android I have this part of code: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); if(!prefs.getBoolean("firstTime", false)) { new DatabaseHelper(this); } } Lint is now saying ‘DatabaseHelper’ used without ‘try’-with-resources statement In DatabaseHelper class I have this: DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, 2); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("CREATE… Read More Android – try with resources just for creating database tables

How to get balance according date and ID for every customer_id and currency_id using INNER JOIN

I have a table named as transaction_table: CREATE TABLE transaction_table ( _id INTEGER PRIMARY KEY AUTOINCREMENT, date TEXT, debit REAL, credit REAL, curr_id INTEGER, cus_id INTEGER, FOREIGN KEY (curr_id) REFERENCES currencies(_id) ON DELETE CASCADE, FOREIGN KEY (cus_id) REFERENCES customers(_id) ON DELETE CASCADE ) And assume this data in it: _id date debit credit curr_id cus_id… Read More How to get balance according date and ID for every customer_id and currency_id using INNER JOIN