Create a new class called Xxxcontract, and in the class inside the static inner class inherits Basecolumn, writes the table name and the table column name in the inner class, because the Basecolumns class encapsulates a _id and _count, So the ID doesn't need to be defined by ourselves. The following code shows:
public class Personcontract {public static class person implements basecolumns{public static final String Table_ Name= "Person"; public static final String columns_name= "NAME"; public static final String columns_number= "number"; }}
Replace the data in the SQL statement with the data from the new class in the OnCreate method that inherits the Sqliteopenhelper class
Db.execsql ("CREATE TABLE" + personcontract.person.table_name+ "(" +personcontract.person._id + "integer Primary key AutoIncrement, "+ personcontract.person.columns_name+" varchar (+), "+ personcontract.person.columns_number+ "varchar" + " )";
The original code is the following, if you want to change it will be very cumbersome and error
Db.execsql ("CREATE TABLE Person" (_id integer primary key autoincrement,name varchar(), number varchar) ");
The correct wording for Android build database