zoukankan      html  css  js  c++  java
  • 读信息

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <TextView
        android:id="@+id/tv1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="用户名:"
        android:textSize="30dp"
        android:layout_marginTop="60dp"
        />
    <EditText
        android:id="@+id/et1"
        android:layout_width="600dp"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/tv1"
        android:layout_marginTop="50dp"
        android:textSize="30dp"
        />
    
    <TextView
        android:id="@+id/tv2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="密码:"
        android:textSize="30dp"
        android:layout_marginTop="50dp"
        android:layout_below="@+id/tv1"
        />
    <EditText
        android:id="@+id/et2"
        android:layout_width="600dp"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/tv2"
        android:layout_marginTop="30dp"
        android:textSize="30dp"
        android:layout_below="@+id/et1"
    
        />
    
    
        <Button
            android:layout_marginTop="80dp"
            android:layout_width="300dp"
            android:layout_height="wrap_content"
            android:text="注册"
            android:textSize="50dp"
            android:layout_below="@+id/et2"
            android:layout_centerHorizontal="true"
            android:onClick="click"
            />
    </RelativeLayout>
    package com.example.ccc;
    
    import android.content.Context;
    import android.database.sqlite.SQLiteDatabase;
    import android.database.sqlite.SQLiteDatabase.CursorFactory;
    import android.database.sqlite.SQLiteOpenHelper;
     
    public class StuOpenHelper extends SQLiteOpenHelper{
     
        public StuOpenHelper(Context context) {
            super(context, "stu.db", null, 5);
            // TODO Auto-generated constructor stub
        }
     
        @Override
        public void onCreate(SQLiteDatabase db) {
            System.out.println("第一次创建");
            String sql = "CREATE TABLE stu (_id integer PRIMARY KEY AUTOINCREMENT,USERNAME VARCHAR(20),PASSWORD  VARCHAR(20))";
            db.execSQL(sql);
             
        }
     
        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            // TODO Auto-generated method stub
                System.out.println("更新"+oldVersion+"  "+newVersion);
                if(oldVersion==5 && newVersion==6) {
                    String sql = "CREATE TABLE bj (_id integer PRIMARY KEY AUTOINCREMENT,CLASSNAME VARCHAR(20))";
                    db.execSQL(sql);
                }
     
        }
    }
  • 相关阅读:
    RPMBUILD源码打包资源汇总(转)
    grep命令:查看配置文件未注释行(转)
    数据结构实验之查找三:树的种类统计(SDUT 3375)
    数据结构实验之查找三:树的种类统计(SDUT 3375)
    数据结构实验之查找四:二分查找(SDUT 3376)
    数据结构实验之查找五:平方之哈希表 (SDUT 3377)
    数据结构实验之查找一:二叉排序树 (SDUT 3373)
    python 正则表达式
    python #!/usr/bin/python 的作用
    欢迎使用CSDN的markdown编辑器
  • 原文地址:https://www.cnblogs.com/527x/p/14108881.html
Copyright © 2011-2022 走看看