课程设计
Android应用程序开发
课程设计报告
(2019—2020学年 第Ⅰ学期)
基于Android的图书管理系统
系 别 信息与控制工程
专 业 计算机科学与技术
班 级 1701
姓 名 刘畅
指导教师 郭 丹
目录
一、 摘要3
二、 需求分析3
2.1 需求分析 3
2.2 UML需求用例图及用例分析说明 4
三、 系统设计5
3.1 系统总体设计 5
3.2系统数据库设计 5
3.3系统详细设计 5
3.4各模块功能 6
3.5 UML设计 7
四、系统测试8
4.1项目测试 8
4.2测试结果 8
五、系统实现11
5.1页面布局 11
附件 24
一、摘要
图书管理系统是基于Android平台下开发的一款图书管理系统客户端,它拥有图书管理模块,在图书管理模块主要有添加图书、修改图书、删除图书、查询图书等功能。
从前管理图书信息和查看图书信息,都需要去图书馆或者登陆网站进行查看。现在是用智能手机就能直接查看图书信息、管理图书信息等功能,大大的方便了人们,节约了人们大量的时间。所以,从这些地方能够看出来,拥有一个图书馆里系统是相当有重要性的。本图书馆管理系统,能够适用于各类图书馆,具有良好的可操作性,可以随时的査询你所需要的图书信息,只要你的智能手机安装了本系统客户端,这大大的方便了学生对图书馆书籍的査询。
二、需求分析
2.1 需求分析
本图书管理系统目标是相当明确的,就是要给予使用者有更多的便利,不使的看书的人走到哪里都要拿着一大本很厚很厚的书本,这就在很大的程度上减少了想看书的人的包袱。
在各种软件争相竞争的今天,一个好的软件对于一个手机来说是至关重要的,对于用户来说也是不可或缺的。对于校内的图书馆管理系统来说,手机对于学生是必不可少的一个物品,手机客户端这种形式的图书馆管理系统,能更加贴近学生的生活习惯,并且适合学生年龄段的习性,这对学生更多的接触到图书馆的信息有一定得促进作用。本本图书管理系统,具有良好的可操作性,可以随时的査询你所需要的图书信息,只要你的智能手机安装了本系统客户端,接入互联网后就可以访问到书籍信息,大大的方便了学生对图书书籍的査询等。程序是基于android系统设计出来的一款图书管理系统客户端,它主要有注册、书籍查询、添加图书、删除图书等功能。
2.2 UML需求用例图及用例分析说明
本图书管理系统具有四个功能:查询、添加、修改、删除。
查询:对已录入的图书信息进行以图书名称为查询点的查询。
添加:添加图书的作者、书籍名。
修改:对以录入的书籍的名称、作者、出版日期、出版社、图书简介进行修改。
删除:对以录入的图书信息进行整体的删除。
三、系统设计
3.1 系统总体设计
3.2 系统数据库设计
字段名 |
数据类型 |
长度 |
主键 |
索引 |
外键 |
可空 |
说明 |
_id |
String |
|
否 |
|
否 |
否 |
录入图书编号 |
MANAGER_AUTHOR |
String |
|
否 |
|
否 |
否 |
图书作者 |
MANAGER_TITLE |
String |
|
否 |
|
否 |
否 |
图书序号 |
3.3 系统详细设计
3.1.1 添加模块
编号 |
输入 |
处理 |
输出 |
1 |
书籍作者 书籍名称 |
根据输入书籍信息从数据库中找一个是否有一样的 |
成功则在列表中显示该书籍的信息 |
3.1.2 查询模块
编号 |
输入 |
处理 |
输出 |
1 |
书籍名称 |
根据输入书籍名称从数据库中查找此书籍的信息 |
成功则在列表中显示该书籍的信息 |
3.1.3 修改模块
编号 |
输入 |
处理 |
输出 |
1 |
书籍名称 书籍作者 出版日期 出版社 图书简介 |
根据输入的新的书籍名称从数据库中查找此书籍的全部信息,修改此书籍的全部信息 |
成功则在列表中显示该图书的信息 |
3.1.4 删除模块
编号 |
输入 |
处理 |
输出 |
1 |
|
根据想要删除的图书信息从数据库中删除 |
删除的图书消失 |
3.4 各模块功能
本系统一共有四个主要的功能:查询、添加、修改、删除某个书籍所有信息。
查询模块
点击查询按钮,服务器进入一个查询界面,在填写完想要查询的书籍名称后,之后点击查询按钮,服务器中会有相应的函数来接收表单发送来的数据,访问数据库并输出此书籍。
添加模块
点击添加按钮,服务器进入一个添加界面,在填写完想要添加的一本书籍的名称、作者后,之后点击添加按钮,服务器会将数据插入到数据库中,如果插入成功会在界面显示该书籍的名称、作者,如果输入某项为空,则会显示输入有误,请核对!
修改模块
点击修改按钮,服务器进入一个修改界面,点击想要修改的图书名称、书籍作者、出版日期、出版社和图书简介,修改图书信息,之后点击修改按钮,服务器会将数据插入到数据库中,如果插入成功会在界面显示该图书修成功,如果未修改,则会显示输入有误,请核对!
删除模块
点击删除按钮,服务器进入一个删除界面,点击想要删除的书籍信息之后点击删除按钮,服务器会将数据从数据库中删除。
3.5 UML设计
3.5.1 UML时序图
3.5.2.系统类图
四、系统测试
本次课程设计所用的开发环境为:eclipse
开发技术:Android
数据库:SQLite数据库
4.1 项目测试
1、测试系统是否能在虚拟机中正常打开
2、测试系统增加、修改、查询、删除界面是否正常显示
3、测试系统增加、修改、查询、删除按钮是否能点击
4、测试数据库能否顺利连接
5、测试增加功能是否正常使用
6、测试查询功能是否正常使用
7、测试修改功能是否正常使用
8、测试删除功能是否正常使用
9、测试系统是否能在手机中正常打开和显示
4.2 测试结果
4.2.1添加图书页
4.2.2删除图书页
4.2.3修改图书页
4.2.4查询图书页
五、系统实现
5.1 界面布局
5.1.1 登录
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/backgroung"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="40dp"
android:text="图书管理系统"
android:textColor="#000000"
android:textSize="20dp" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="140dp"
android:text="用户名:"
android:textColor="#000000"
android:textSize="15dp" />
<EditText
android:id="@+id/insert_editName_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView2"
android:layout_alignBottom="@+id/textView2"
android:layout_toRightOf="@+id/textView2"
android:ems="10"
android:inputType="text"
android:lines="1"
android:singleLine="true"
android:textColor="#000000" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="200dp"
android:text="密 码:"
android:textColor="#000000"
android:textSize="15dp" />
<EditText
android:id="@+id/EditText01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView4"
android:layout_alignBottom="@+id/textView4"
android:layout_alignRight="@+id/insert_editName_id"
android:layout_toRightOf="@+id/textView2"
android:ems="10"
android:inputType="text"
android:lines="1"
android:singleLine="true"
android:textColor="#000000" />
<Button
android:id="@+id/insert_button_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/EditText01"
android:layout_marginTop="53dp"
android:layout_toRightOf="@+id/textView4"
android:text="登录" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/insert_button_id"
android:layout_alignBottom="@+id/insert_button_id"
android:layout_alignRight="@+id/EditText01"
android:layout_marginRight="24dp"
android:text="注册" />
</RelativeLayout>
</FrameLayout>
5.1.2 主页面
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/backgroung"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/img_1" >
<ImageView
android:id="@+id/add"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="60dp"
android:layout_marginTop="100dp"
android:src="@drawable/tianjia" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="52dp"
android:layout_marginTop="160dp"
android:text="添加图书"
android:textColor="#000000"
android:textSize="15dp" />
<ImageView
android:id="@+id/delect"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="200dp"
android:layout_marginTop="100dp"
android:src="@drawable/shanchu" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="192dp"
android:layout_marginTop="160dp"
android:text="删除图书"
android:textColor="#000000"
android:textSize="15dp" />
<ImageView
android:id="@+id/update"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="60dp"
android:layout_marginTop="240dp"
android:src="@drawable/xiugai" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="52dp"
android:layout_marginTop="300dp"
android:text="修改图书"
android:textColor="#000000"
android:textSize="15dp" />
<ImageView
android:id="@+id/query"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="200dp"
android:layout_marginTop="240dp"
android:src="@drawable/chaxun" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="192dp"
android:layout_marginTop="300dp"
android:text="查询图书"
android:textColor="#000000"
android:textSize="15dp" />
</RelativeLayout>
</FrameLayout>
5.2.3 添加
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/backgroung"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/img_1" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="80dp"
android:text="作 者:"
android:textColor="#000000"
android:textSize="15dp" />
<EditText
android:id="@+id/insert_editName_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView2"
android:layout_alignBottom="@+id/textView2"
android:layout_toRightOf="@+id/textView2"
android:ems="10"
android:inputType="text"
android:lines="1"
android:singleLine="true"
android:textColor="#000000" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="140dp"
android:text="书 名:"
android:textColor="#000000"
android:textSize="15dp" />
<EditText
android:id="@+id/EditText01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView4"
android:layout_alignBottom="@+id/textView4"
android:layout_alignRight="@+id/insert_editName_id"
android:layout_toRightOf="@+id/textView2"
android:ems="10"
android:inputType="text"
android:lines="1"
android:singleLine="true"
android:textColor="#000000" />
<Button
android:id="@+id/insert_button_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/EditText01"
android:layout_below="@+id/EditText01"
android:layout_marginTop="15dp"
android:text="添加" />
<TextView
android:id="@+id/layoutColumn_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="230dp"
android:text="书号"
android:textColor="#000000"
android:textSize="15dp" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="135dp"
android:layout_marginTop="230dp"
android:text="作者"
android:textColor="#000000"
android:textSize="15dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="245dp"
android:layout_marginTop="230dp"
android:text="书名"
android:textColor="#000000"
android:textSize="15dp" />
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/EditText01"
android:layout_below="@+id/layoutColumn_id"
android:layout_marginTop="98dp"
android:orientation="vertical" >
</LinearLayout>
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/layoutColumn_id"
android:layout_marginTop="10dp" >
</ListView>
</RelativeLayout>
</FrameLayout>
5.1.4 删除
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/backgroung"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/img_1" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="80dp"
android:text="作 者:"
android:textColor="#000000"
android:textSize="15dp" />
<EditText
android:id="@+id/insert_editName_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView2"
android:layout_alignBottom="@+id/textView2"
android:layout_toRightOf="@+id/textView2"
android:ems="10"
android:inputType="text"
android:lines="1"
android:singleLine="true"
android:textColor="#000000" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="140dp"
android:text="书 名:"
android:textColor="#000000"
android:textSize="15dp" />
<EditText
android:id="@+id/EditText01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView4"
android:layout_alignBottom="@+id/textView4"
android:layout_alignRight="@+id/insert_editName_id"
android:layout_toRightOf="@+id/textView2"
android:ems="10"
android:inputType="text"
android:lines="1"
android:singleLine="true"
android:textColor="#000000" />
<Button
android:id="@+id/insert_button_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/EditText01"
android:layout_below="@+id/EditText01"
android:layout_marginTop="15dp"
android:text="删除" />
<TextView
android:id="@+id/layoutColumn_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="230dp"
android:text="书号"
android:textColor="#000000"
android:textSize="15dp" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="135dp"
android:layout_marginTop="230dp"
android:text="作者"
android:textColor="#000000"
android:textSize="15dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="245dp"
android:layout_marginTop="230dp"
android:text="书名"
android:textColor="#000000"
android:textSize="15dp" />
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/EditText01"
android:layout_below="@+id/layoutColumn_id"
android:layout_marginTop="98dp"
android:orientation="vertical" >
</LinearLayout>
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/layoutColumn_id"
android:layout_marginTop="10dp" >
</ListView>
</RelativeLayout>
</FrameLayout>
5.1.5 修改
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/backgroung"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/img_1" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="40dp"
android:text="修改图书信息"
android:textColor="#000000"
android:textSize="20dp" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="100dp"
android:text="书 名:"
android:textColor="#000000"
android:textSize="15dp" />
<EditText
android:id="@+id/insert_editName_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView2"
android:layout_alignBottom="@+id/textView2"
android:layout_toRightOf="@+id/textView2"
android:ems="10"
android:inputType="text"
android:lines="1"
android:singleLine="true"
android:textColor="#000000" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="140dp"
android:text="作 者:"
android:textColor="#000000"
android:textSize="15dp" />
<EditText
android:id="@+id/EditText01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView4"
android:layout_alignBottom="@+id/textView4"
android:layout_alignRight="@+id/insert_editName_id"
android:layout_toRightOf="@+id/textView2"
android:ems="10"
android:inputType="text"
android:lines="1"
android:singleLine="true"
android:textColor="#000000" />
<Button
android:id="@+id/insert_button_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="120dp"
android:layout_marginTop="330dp"
android:text="提交 " />
</RelativeLayout>
</FrameLayout>
5.1.6 查询
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/backgroung"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/img_1" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="80dp"
android:text="输入书名查询"
android:textColor="#000000"
android:textSize="15dp" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:layout_marginTop="25dp"
android:ems="10"
android:inputType="text"
android:lines="1"
android:singleLine="true"
android:textColor="#000000" />
<Button
android:id="@+id/insert_button_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/editText1"
android:layout_alignBottom="@+id/editText1"
android:layout_alignParentRight="true"
android:text="查询" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:layout_marginTop="180dp"
android:text="推荐阅读"
android:textColor="#000000"
android:textSize="15dp" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="80dp"
android:layout_height="120dp"
android:layout_marginLeft="50dp"
android:layout_marginTop="220dp"
android:src="@drawable/sanguo" />
<ImageView
android:layout_width="80dp"
android:layout_height="120dp"
android:layout_marginLeft="180dp"
android:layout_marginTop="220dp"
android:src="@drawable/shuihu" />
<ImageView
android:layout_width="80dp"
android:layout_height="120dp"
android:layout_marginLeft="50dp"
android:layout_marginTop="350dp"
android:src="@drawable/honglou" />
<ImageView
android:layout_width="80dp"
android:layout_height="120dp"
android:layout_marginLeft="180dp"
android:layout_marginTop="350dp"
android:src="@drawable/xiyou" />
</RelativeLayout>
</FrameLayout>
附件:
一、课设题目
基于Android的图书管理系统
二、技术说明
1.Activity之间的跳转
实现页面跳转
2. Sqlite数据库
实现数据的添加功能
3.控件的使用
Textview 、Button 等
4.Listview的使用
两个适配器的调试
5.事件的监听
OnClickListener()方法实现监听
6.页面布局
使用线性布局(RelativeLayout)
三、UML类图
四、代码
清单文件:
JAVA文件:
布局文件:
- 布局文件