package me.apqx.raspberrypi;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * Created by chang on 2016/7/30.
 */
public class MySQLHelper extends SQLiteOpenHelper {
    private static final String CREATE_BOOK="create table raspberry(" +
            "id integer primary key autoincrement," +
            "ip1 integer," +
            "ip2 integer," +
            "ip3 integer," +
            "ip4 integer)";
    public MySQLHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_BOOK);
        ContentValues contentValues=new ContentValues();
        contentValues.put("ip1",192);
        contentValues.put("ip2",168);
        contentValues.put("ip3",1);
        contentValues.put("ip4",240);
        db.insert("raspberry",null,contentValues);
        Log.d("apqx","初始化数据");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}

@@ -1066,39 +1066,8 @@
 s);%0A
-        Log.d(%22apqx%22,%22%E5%88%9D%E5%A7%8B%E5%8C%96%E6%95%B0%E6%8D%AE%22);%0A
     

添加IP地址记忆功能，自动填充上次使用的IP地址