[Solved] I cannot get the app to construct an sqlite database

You aren’t, according to the code, acessing(opening) the database. You are just instantiating the DatabseHelper in MainActivity i.e. mydb = new CrdDBHelper(this); It is not until an attempt is made to open the database (which is frequently implicit) that the database is actually created. A simple way would be to force an open when instantiating … Read more

[Solved] no such table: main.course_name

Unfortunately i did not write any query to create the above table causing the error. Assuming that you really meant to say i did not write any query to use the above table; you did implicitly by defining teacher_table table with :- +”FOREIGN KEY(“+courseId+”)”+” REFERENCES “+CourseTable.courseName+”(“+CourseTable.courseID+”)” That is to insert into the teacher_table the value … Read more

[Solved] SQLiteOpenHelper.getReadableDatabase() method is crashing

Thank you all…i’ve found the answer….i was calling the getAccountById method from a fragment…so i must re-pass the Context again to it UpdateAccountFragment a = new UpdateAccountFragment(accountID,getActivity()); and the constructor of the UpdateAccountFragment look like public UpdateAccountFragment (int accountID , Context context) { this.context = context; this.accountID = accountID; } 1 solved SQLiteOpenHelper.getReadableDatabase() method is … Read more

[Solved] I entered the data in slqite database still cursor.getCount() is null and the Error :- Invalid tables

A cursor allows you to access the query result set. The query result set does not change if you insert new data after querying. Hence the cursor count stays at 0. You need to query your database again to see the new data. The NPE seen as warning in your System.err log is not produced … Read more