If we talk about the database that we make in runtime then we can understand that but most people get confused in the second case when we use the pre-populated database. While developing the application either we provide the pre-populated database or make the database at runtime but in both cases, we can not see the database of the device directly. There are lots of confusion in people related to How to see the SQLite database? and that is the main reason behind writing this post. This is an extended post of our previous post Example of SQLite Database in React Native and Example to Load Pre Populated SQLite Database in React Native. This post has the steps to see the data stored in the SQLite database in the device. Hope you like this article.Here is How to See SQLite Database Data Saved in Device using Android Studio. This was a simple Android SQLite Database tutorial, in which we learn how to add a Record to Database, Delete a Record and fetch a Record from Database. SQLiteDatabase db = this.getWritableDatabase() Ĭursor cursor = db.rawQuery(query, null) String query = "Select*FROM " + TABLE_NAME getString(0) to getString(3) fetches all records from all four columns 0 to 3. We have a Cursor class which is like a pointer which iterates through the cursor and sets the pointer to the desired position. We have used a query variable which uses SQL query to fetch all rows from the table. This code allows us to fetch all records of a particular Table stored in our Database. Public class MyDBHandler extends SQLiteOpenHelper Android SQLite Database Tutorial (ADD, DELETE, FETCH) 10 Android SQLite Database Tutorial (ADD, DELETE, FETCH) 11 Android SQLite Database Tutorial (ADD, DELETE, FETCH) 12 TO FETCH RECORD Make a Java File Name MYDBHANDLER.JAVA package
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |