Step 1: Add coverUrl field
public class Book {
private int id;
private String title;
private String author;
private String isbn;
private String coverUrl;
Step 2: Create getters and setters.
Step 3: increment database version since we are modifying the structure:
private static final int DATABASE_VERSION = 2;
Step 4: in class BookSqlHelper add field
private static final String FIELD_COVER_URL = "cover_url";
private static final String[] COLUMNS = { //
FIELD_ID, // 0
FIELD_TITLE, // 1
FIELD_AUTHOR, // 2
FIELD_ISBN, // 3
FIELD_LOCATION, // 4
FIELD_COVER_URL // 5 };
Step 5: Change all CRUD methods.
for example:
No comments:
Post a Comment