![]() ![]() Step 3 − Add the following code to src/MainActivity. In the above code, we have taken name and salary as Edit text, when user click on save button it will store the data into sqlite data base and update on listview. Step 2 − Add the following code to res/layout/activity_main.xml. The SQLiteOpenHelper is responsible for opening database if exist, creating database if it does not exists and upgrading if required. It provides two methods onCreate(SQLiteDatabase db), onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion). Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. SQLiteOpenHelper is a helper class to manage database creation and version management. This example demonstrate about How to use SELECT Query in Android sqlite. In order to access this database, you don't need to establish any kind of connections for it like JDBC, ODBC etc. SQLite supports all the relational database features. Android comes in with built in SQLite database implementation. SQLite is an opensource SQL database that stores data to a text file on a device. ![]() Before getting into example, we should know what sqlite data base in android is.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |