什么是SQLite
SQLite 是一个软件库,实现了自给自足的、无服务器的、零配置的、事务性的 SQL 数据库引擎。SQLite 是在世界上最广泛部署的 SQL 数据库引擎。SQLite 源代码不受版权限制。
以下是一些关于SQLite学习的有用的网站:
1、SQLite Home Page - SQLite 官方网站提供了最新的 SQLite 安装版本,最新的 SQLite 资讯以及完整的 SQLite 教程。
2、PHP SQLite3 - 网站提供了 SQLite 3 数据库的 PHP 支持的完整细节。
3、DBD-SQLite-0.31 - SQLite Perl driver 驱动程序与 Perl DBI 模块一起使用。
4、DBI-1.625 - Perl DBI 模块为包括 SQLite 在内的任何数据库提供了通用接口。
5、SQLite Python - sqlite3 python 模块由 Gerhard Haring 编写的。它提供了与 DB-API 2.0 规范兼容的 SQL 接口。
项目简述
本次的APP主要要实现两个功能:
1、实现数据库的操作(创建数据库、存入数据——注册、查询并使用数据——登录)。
2、基本的页面跳转以及跳转时数据的携带。
布局文件
activity_main.xml
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:rowCount="5"
android:columnCount="2">
<TimePicker
android:layout_columnSpan="2"/>
<TextView
android:text="用户名:"
android:layout_row="1"
android:layout_column="0"
android:layout_marginLeft="65dp"
/>
<EditText
android:id="@+id/username"
android:layout_row="1"
android:layout_column="1"
android:layout_marginLeft="-200dp"
android:ems="7"
/>
<TextView
android:text="密码:"
android:layout_row="2"
android:layout_column="0"
android:layout_marginLeft="80dp"
/>
<EditText
android:id="@+id/password"
android:layout_row="2"
android:layout_column="1"
android:inputType="textPassword"
android:layout_marginLeft="-200dp"
android:ems="7"
/>
<LinearLayout
android:weightSum="1.5"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:layout_marginLeft="50dp"
>
<Button
android:id="@+id/login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="登录"
android:layout_weight="0.5"
/>
<Button
android:id="@+id/resign"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="注册"
android:layout_weight="0.5" />
<Button
android:id="@+id/btn_new"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="重置"
android:layout_weight="0.5"
/>
</LinearLayout>
<DatePicker
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_columnSpan="2"/>
</GridLayout>
效果如下:
activity_success.xml
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"