???????????????????飬???????????????????????????????????onCreate?????????????????????????????????????????????汾??????????д?????????汾???£?????????????????????????(updated)??????????????£??????onUpgrade??????

????????????????????????????onCreate??????е??????????????????????????????????????????????????????????????????????????????????????Σ????????????????е????κ???????????????????Э??????????

????????????????????????????????????????????????£???????????????????????????????????????????SQL????????????
 
CREATE TABLE employees (
 _id INTEGER PRIMARY KEY AUTOINCREMENT??
 name TEXT NOT NULL??
 ext TEXT NOT NULL??
 mob TEXT NOT NULL??
 age INTEGER NOT NULL DEFAULT '0'
);

???????????????????hard coding?????????????д????????У???ж????У????????£?
 
@Override
public void onCreate(SQLiteDatabase database) {
    database.execSQL(
     
 "CREATE TABLE employees ( _id INTEGER PRIMARY KEY "
    + "AUTOINCREMENT?? name TEXT NOT NULL?? ext TEXT NOT NULL?? "
    + "mob TEXT NOT NULL?? age INTEGER NOT NULL DEFAULT '0')");
}

???????????????????????????????С???????????????????????????????????????????????????????????????SQL?????????asset????С????????????????????д?????????assets???ж??SQL???????????????

@Override
public void onCreate(SQLiteDatabase database) {
    executeSQLScript(database?? "create.sql");
}
 
private void executeSQLScript(SQLiteDatabase database?? string dbname){
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        byte buf[] = new byte[1024];
        int len;
        AssetManager assetManager = context.getAssets();
        InputStream inputStream = null;
 
        try{
            inputStream = assetManager.open(dbname);
            while ((len = inputStream.read(buf)) != -1) {
                   outputStream.write(buf?? 0?? len);
                }
            outputStream.close();
            inputStream.close();
                String[] createScript = outputStream.toString().split(";");
                for (int i = 0; i < createScript.length; i++) {
                    String sqlStatement = createScript[i].trim();
                    // TODO You may want to parse out comments here
                    if (sqlStatement.length() > 0) {
                        database.execSQL(sqlStatement + ";");
                    }
            }
       } catch (IOException e){
            // TODO Handle Script Failed to Load
        } catch (SQLException e) {
            // TODO Handle Script Failed to Execute
       }
}