|
| 1 | +# Android-app-using-SQLite |
| 2 | +Android App which uses SQLite Database to store and retrieve data. |
| 3 | + |
| 4 | +<h2>Screenshots</h2> |
| 5 | + |
| 6 | +<img src = "https://github.com/lakshay1296/Android-app-using-SQLite/blob/master/Screenshot_1528349407.png" height = "520" width = "300" /> <img src = "https://github.com/lakshay1296/Android-app-using-SQLite/blob/master/Screenshot_1528349424.png" height = "520" width = "300" /> |
| 7 | + |
| 8 | +<h2><b>Features</b></h2> |
| 9 | + |
| 10 | +1. Add new data |
| 11 | + |
| 12 | +2. Update existing data |
| 13 | + |
| 14 | +3. Update single, multiple or all the fields present in the database |
| 15 | + |
| 16 | +4. Delete data |
| 17 | + |
| 18 | +5. View data |
| 19 | + |
| 20 | +6. Automatic Date and Time insertion |
| 21 | + |
| 22 | +7. Easy to implement and make changes |
| 23 | + |
| 24 | +<h2><b>How to use</b></h2> |
| 25 | + |
| 26 | +1. Just copy the code and classes to your project <b>or</b> |
| 27 | + |
| 28 | +2. Import project to android studio |
| 29 | + |
| 30 | +<h2><b>How to make changes in table</b></h2> |
| 31 | + |
| 32 | +If you want to add or remove columns from table: |
| 33 | + |
| 34 | +1. You need to add or remove column name from the "create table" query. |
| 35 | + |
| 36 | +2. Update the version of the database which can be found in <b>DatabaseHelper.java</b> |
| 37 | + |
| 38 | +``` |
| 39 | +public DatabaseHelper(Context context) { |
| 40 | + super( context, DATABASE_NAME, null, 2 ); |
| 41 | +
|
| 42 | + } |
| 43 | +``` |
| 44 | +Here, integer 2 mentions the version. |
| 45 | + |
| 46 | +3. After adding columns update AddData() or updateData() methods so that they can accept values for the extra columns. |
| 47 | + |
| 48 | +``` |
| 49 | + public boolean instertData(String name, String surname, String marks, String date){ |
| 50 | + // Rest of the code |
| 51 | + } |
| 52 | +``` |
| 53 | + |
| 54 | +4. Add new column in <b>ContentValues</b> for inserting or updating the values in database. |
| 55 | +``` |
| 56 | +contentValues.put( "Column name which is defined in database", "value of the method which you need to insert in the column of DB, For eg. name" ); |
| 57 | +``` |
| 58 | +That's it! It's a very simple app which helps you in understanding the concept of implementing SQLite Database in an Android application. |
0 commit comments