图书管理系统课程设计报告

 

 

 

 

 

 

图书管理课程设计报告

 

 

 

 

专业        计算机科学与技术   

 班级            1701                    

学号          173230117            

 姓名           张明珠                  

指导老师        郭丹                  

 

 


目录

一、 开发背景................................................. 3

二、 需求分析................................................. 3

2.1系统的准备.................................................. 3

2.2知识准备.................................................... 3

2.3功能分析.................................................... 3

2.4开发技术分析................................................ 3

三、 系统设计................................................. 3

3.1系统目标 .................................................. 3

3.2系统功能.................................................... 4

3.3系统用例图.................................................. 4

3.4核心模块时序图.............................................. 5

3.5核心模块类图................................................ 5

3.6数据库设计.................................................. 6

四. 系统测试................................................. 6

4.1页面无法跳转................................................ 6

4.2 按钮无反应.................................................. 7

4.3 功能未实现.................................................. 7

五. 系统实现................................................. 8

六. 心得体会................................................ 15

附件1:..................................................... 16

 

 

 

 

 

 

 

 

 

 


图书管理系统

一、开发背景

随着智能手机的普及,基于Android平台的应用软件需求也越来越多。宁波东蓝数码有限公司是一家规模较大的软件公司,随着公司规模的不断扩大,目前新增了大量基于Android智能手机方面的业务,但由于业务量较大,公司内部开发人员一时无法满足要求,现需要外包一些智能手机应用软件。现假设你所在的公司承接了该公司智能手机外包项目的开发工作。Android平台下的图书管理系统的开发,能很好的为用户提供方便,用户能通过它能随时随地的了解系统的实时信息,做到信息的实时化。同时,对于校内的图书管理系统来说,手机对于学生是必不可少的一个物品,手机客户端这种形式的图书管理系统,能更加贴近学生的生活习惯,并且适合学生年龄段的习性,这对学生更多的接触到图书馆的信息有一定得促进作用。

二、需求分析

2.1系统的准备

操作系统: Android

数据库系统: SQLite

2.2知识准备

熟悉SQLite的使用: .熟悉Java、Android studio、XML等语言进行数据库编程。

2.3功能分析

基于Android平台开发的图书管理系统客户端从设计者的角度来看,用户角色主要为学生用户;功能包括注册、登录、书籍查询、增加一本好书、修改阅读进度、删除阅读记录等。

2.4开发技术分析

该系统是基于Eclipse软件并连接Android SDK进行开发的基于Android平台开发的图书管理系统,数据库采用较小速度快的SQLite, 是嵌入式移动设备中常用的轻量级数据库。软件UI通常使用xml技术设计,由于布局的使用,并且布局之间可以互相嵌套,使得android软件UI的设计变得非常灵活,力求图书与学生之间更加亲近方便。

三、系统设计

3.1系统目标 

(1)系统采用人机交互的方式,界面美观友好,信息查询灵活、方便,数据存储安全可靠;   

(2)能够让学生更好更方便的了解图书和阅读图书;

(3)丰富学生知识,增加学生阅读积极性;

(4)能够对学生信息进行有效的管理;

(5)能够准确、详细地了解学生的每月阅读量;

3.2系统功能

本系统的具体功能如下:

1. 图书管理:新增、浏览图书。

2.我的书库: 学生查看阅读过的图书、书名、图书的作者、阅读量和总量。

3.修改阅读进度:可以根据阅读进度修改阅读量,记录阅读的页数。

4.删除阅读记录:看完的图书可以及时删除,不占内存。

5.退出登录:阅读完成之后退出登录。

本系统的系统结构功能图如图所示:

                     系统结构功能图

3.3系统用例图

3.4核心模块时序图

 

                            图书管理时序图

3.5核心模块类图

                                    图书管理类图

3.6数据库设计

由于本系统是在校学生使用的软件,需要充分考虑图书管理和学生阅读需求等问题,而SQLite是一款轻型的数据库,它占用资源非常的低,在嵌入式设备中,可能只需要几百K的内存就够了。处理速度快,效率高,正好满足了手机app的需求,所以本系统采用SQLite数据库。

 四.系统测试

4.1页面无法跳转

在做完第一个页面的时候,我非常开心,但是当我要跳转到第二个页面的时候,遇到了难题,我卡在了页面跳转。

 后来,我上百度搜索这个问题怎么解决,原来是因为新增页面没有在AndroidManifest.xml中配置,然后就解决了这个问题。

4.2 按钮无反应

在设计第二个页面的时候,有三个按钮,点他没有反应,我当时都要崩溃了,调试了很久的代码,还是出不来。

我上网查怎么点按钮实现连接,到下一个页面,经过很多次调试,终于解决了,发现提示框是toast方法,而跳转页面是intent方法。

4.3 功能未实现

做完第三页的代码之后我运行了一下,它没有实现该有的功能,没有出来图书信息,我真的好难啊!遇到好多问题,但最后还是解决了。

 经过我不懈的努力,不放弃,终于解决了这些问题!虽然还有很多功能不能实现,也做得特别简单,但是这是我努力的开始,我会越来越认真的。

四.系统实现

部分关键代码如下:

<LinearLayout 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"

    android:background="@drawable/sbbj"

    android:orientation="vertical" >

 

    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:layout_gravity="center"

        android:orientation="vertical" >

 

        <TextView

            android:id="@+id/loginxx"

            android:layout_width="80dp"

            android:layout_height="80dp"

            android:layout_gravity="center"

            android:layout_marginBottom="30dp"

            android:layout_marginTop="10dp" />

    </LinearLayout>

<LinearLayout

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:orientation="vertical" >

<EditText

            android:id="@+id/name"

            android:layout_width="match_parent"

            android:layout_height="50dp"

            android:hint="请输入账号"

            android:paddingLeft="20dp"

            android:textColor="#CC0066"

            android:textSize="14sp" />

 

        <View

            android:layout_width="match_parent"

            android:layout_height="1dp"

            android:background="#11000000" />

 

        <EditText

            android:id="@+id/password"

            android:layout_width="match_parent"

            android:layout_height="50dp"

            android:hint="请输入密码"

            android:paddingLeft="20dp"

            android:textColor="#CC0066"

            android:textSize="14sp" />

    </LinearLayout>

 

    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:layout_marginTop="20dp"

        android:gravity="center" >

<Button

            android:id="@+id/login_button"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:layout_marginLeft="20dp"

            android:layout_marginRight="20dp"

            android:gravity="center"

            android:onClick="clicklogin"

            android:text="登  录"

            android:textColor="#ffffffff"

            android:textSize="16sp" />

    </LinearLayout>

 

    <LinearLayout

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:gravity="bottom"

        android:orientation="horizontal" >

 

        <TextView

            android:id="@+id/non"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_gravity="bottom"

            android:layout_margin="5dp"

            android:layout_weight="1"

            android:text="无法登录点我找回密码" />

 

        <TextView

            android:id="@+id/news"

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:layout_gravity="bottom|right"

            android:layout_margin="5dp"

            android:gravity="left"

            android:text="新用户点我注册" />

    </LinearLayout>

</LinearLayout>

这是登录、注册页面的代码。(部分代码)

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:background="@drawable/sbbj"

    android:orientation="vertical" >

<LinearLayout

        android:id="@+id/isbn"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:layout_centerHorizontal="true"

        android:layout_marginLeft="10dp"

        android:layout_marginRight="10dp"

        android:layout_marginTop="52dp"

        android:orientation="horizontal" >

<TextView

            android:layout_width="90dp"

            android:layout_height="wrap_content"

            android:gravity="right"

            android:paddingRight="5dp"

            android:text="书号 :" />

<EditText

            android:id="@+id/et_isbn"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:hint="请输入这是您读的第几本书"

            android:textSize="14dp" />

    </LinearLayout>

<LinearLayout

        android:id="@+id/title"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:layout_below="@+id/isbn"

        android:layout_centerHorizontal="true"

        android:layout_marginLeft="10dp"

        android:layout_marginRight="10dp"

        android:layout_marginTop="5dp"

        android:orientation="horizontal" >

<TextView

            android:layout_width="90dp"

            android:layout_height="wrap_content"

            android:gravity="right"

            android:paddingRight="5dp"

            android:text="书名" />

<EditText

            android:id="@+id/et_title"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:hint="请输入书名"

            android:textSize="14dp" />

    </LinearLayout>

<LinearLayout

        android:id="@+id/author"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:layout_below="@+id/title"

        android:layout_centerHorizontal="true"

        android:layout_marginLeft="10dp"

        android:layout_marginRight="10dp"

        android:layout_marginTop="5dp"

        android:orientation="horizontal" >

<TextView

            android:layout_width="90dp"

            android:layout_height="wrap_content"

            android:gravity="right"

            android:paddingRight="5dp"

            android:text="作者" />

<EditText

            android:id="@+id/et_author"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:hint="请输入作者"

            android:textSize="14dp" />

    </LinearLayout>

<LinearLayout

        android:id="@+id/price"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:layout_below="@+id/author"

        android:layout_centerHorizontal="true"

        android:layout_marginLeft="10dp"

        android:layout_marginRight="10dp"

        android:layout_marginTop="5dp"

        android:orientation="horizontal" >

<TextView

            android:layout_width="90dp"

            android:layout_height="wrap_content"

            android:gravity="right"

            android:paddingRight="5dp"

            android:text="阅读量" />

<EditText

            android:id="@+id/et_price"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:hint="请输入您阅读了多少"

            android:textSize="14dp" />

    </LinearLayout>

<LinearLayout

        android:id="@+id/quantity"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:layout_below="@+id/price"

        android:layout_centerHorizontal="true"

        android:layout_marginLeft="10dp"

        android:layout_marginRight="10dp"

        android:layout_marginTop="5dp"

        android:orientation="horizontal" >

<TextView

            android:layout_width="90dp"

            android:layout_height="wrap_content"

            android:gravity="right"

            android:paddingRight="5dp"

            android:text="总量" />

<EditText

            android:id="@+id/et_quantity"

            android:layout_width="match_parent"

            android:layout_height="wrap_content"

            android:hint="请输入书总页"

            android:textSize="14dp" />

    </LinearLayout>

<Button

        android:id="@+id/btn_add"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_below="@+id/quantity"

        android:layout_marginLeft="10dp"

        android:layout_marginTop="24dp"

        android:onClick="click1"

        android:text="增加一本好书" />

<TextView

        android:id="@+id/tv_show"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:layout_alignParentLeft="true"

        android:layout_below="@+id/btn_add"

        android:textSize="17sp" />

 

    <Button

        android:id="@+id/btn_delete"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignParentBottom="true"

        android:layout_alignParentRight="true"

        android:onClick="clickout"

        android:text=" 退出登录  "

        android:textSize="15sp" />

<Button

        android:id="@+id/btn_find"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignParentBottom="true"

        android:layout_alignParentLeft="true"

        android:onClick="click3"

        android:text=" 我的书库  "

        android:textSize="15sp" />

<Button

        android:id="@+id/btn_delete"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_alignParentBottom="true"

        android:layout_toRightOf="@+id/btn_find"

        android:onClick="click4"

        android:text="删除阅读记录" />

<Button

        android:id="@+id/btn_update"

        android:layout_width="wrap_content"

        android:layout_height="wrap_content"

        android:layout_above="@+id/tv_show"

        android:layout_alignRight="@+id/quantity"

        android:onClick="click2"

        android:text="修改阅读进度" />

</RelativeLayout>

实现阅读图书的增删改查。(部分代码)

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout 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"

    android:background="@drawable/sbbj"

    android:gravity="center"

    android:orientation="vertical"

    tools:context=".MainActivity" >

<ImageView

        android:id="@+id/image_view_id"

        android:layout_width="match_parent"

        android:layout_height="0dp"

        android:layout_weight="11"

        android:src="@drawable/img_1" />

<TextView

        android:layout_width="match_parent"

        android:layout_height="0dp"

        android:layout_weight="2"

        android:gravity="center"

        android:text="明珠图书馆"

        android:textColor="#FFCCFF"

        android:textSize="30sp" />

<LinearLayout

        android:layout_width="match_parent"

        android:layout_height="0dp"

        android:layout_weight="4"

        android:orientation="horizontal" >

<Button

            android:id="@+id/introduce_id"

            android:layout_width="0dp"

            android:layout_height="match_parent"

            android:layout_weight="1"

            android:text="图书介绍"

            android:textSize="21sp" />

    </LinearLayout>

<LinearLayout

        android:layout_width="match_parent"

        android:layout_height="0dp"

        android:layout_weight="4"

        android:orientation="horizontal" >

<Button

            android:id="@+id/newBook_id"

            android:layout_width="0dp"

            android:layout_height="match_parent"

            android:layout_weight="1"

            android:onClick="add"

            android:text="新书阅读"

            android:textSize="21sp" />

    </LinearLayout>

<LinearLayout

        android:layout_width="match_parent"

        android:layout_height="0dp"

        android:layout_weight="4" >

<Button

            android:id="@+id/registerStudent_id"

            android:layout_width="0dp"

            android:layout_height="match_parent"

            android:layout_weight="1"

            android:text="我的读书历史"

            android:onClick="list"

            android:textSize="21sp" />

    </LinearLayout>

</LinearLayout>

第二页也是图书管理系统的主页面,包含三块:图书介绍、新书阅读、我的读书历史。(部分代码)

五.心得体会

我们从这个学期开始学的Android,从一开始的0基础,不断的一点点写基础代码,实现基础功能。甚至一开始的时候在基础代码,没有几行的情况下都会有许多错误,询问老师和同学,帮助解决bug。到现在的做完一整个课程设计,心里无比的自豪。这个系统主要实现了管理图书,阅读图书,用户登录注册和修改查询删除等功能。由于自身经验不足,尽管按照书本实现代码,但还是有各种各样的问题。代码出现错误不知如何修改,陷入无尽的迷茫中,因个人的能力有限,有些功能设计打不开,不够完善,有待进一步的改善。但是通过这段时间的锻炼,对于系统设计的理念更为明确,对Eclipse这款软件的运用真的熟悉掌握了不少。相信在以后的系统设计中,我能够吸取经验和教训,能力不断提高。多自学一点,不要老是为自己的懒找借口。

总之,通过此次系统设计,真正深刻体会到了有劲无处使得感觉,想做但又很多都不会,还是要在平时多下功夫,每天自学一点,时间长了就都会了,怕的就是坚持不下来,郭丹老师开学就跟我们说了这个“坚持”!真的!很难,但是很有道理!

 

附件1

1.课设题目:图书管理系统

2.技术说明

通过Java代码调用图片资源,布局资源文件,字符串资源,颜色资源文件,尺寸资源等,在XML布局文件中调用图片资源,布局资源文件,字符串资源颜色资源文件,尺寸资源等。通常有5种布局,分别为相对布局,线性布局,帧布局,表格布局,约束布局等。

3.UML类图

 

  1. 代码

4.1清单文件:

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

    package="com.example.book"

    android:versionCode="1"

    android:versionName="1.0" >

<uses-sdk

        android:minSdkVersion="8"

        android:targetSdkVersion="19" />

    <application

        android:allowBackup="true"

        android:icon="@drawable/ic_launcher"

        android:label="@string/app_name"

        android:theme="@style/AppTheme" >

       

<activity

            android:name="com.example.book.LoginActivity"

            android:label="@string/app_name" >

           

<intent-filter>

                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>

       

</activity>

        <activity android:name="com.example.book.MainActivity"

           android:label="@string/app_name" >

       </activity>

      

<activity android:name="com.example.book.Booklist"

           android:label="@string/app_name" >

       </activity>

      

<activity android:name="com.example.book.Hello"

           android:label="@string/app_name" >

       </activity>

       

</application>

</manifest>

4.2布局文件:

1.截图

    

   

 4.3Java原码

import android.app.Activity;

import android.database.Cursor;

import android.database.sqlite.SQLiteDatabase;

import android.os.Bundle;

import android.widget.TextView;

import android.widget.Toast;

public class Booklist extends Activity{

   Myhelper helper;

   private TextView tv_show;

  

  

   protected void onCreate(Bundle savedInstanceState) {

       super.onCreate(savedInstanceState);

       setContentView(R.layout.booklist);    

       helper = new Myhelper(this);

       init();

   }

  

   public void init() {

       tv_show = (TextView) findViewById(R.id.tv_show);

       SQLiteDatabase db = helper.getWritableDatabase();

       Cursor cursor = db.query("info", null, null, null, null, null, null);

       if (cursor.getCount() == 0) {

          tv_show.setText("");

          Toast.makeText(this, "没有数据!", 1).show();

       } else {

          cursor.moveToFirst();

          tv_show.setText("书号:" + cursor.getString(1) + "   书名:"

                 + cursor.getString(2) + "   作者:" + cursor.getString(3) + "\n已读:"

                 + cursor.getString(4) + "   总页:" + cursor.getString(5) + "\n");

       }

       while (cursor.moveToNext()) {

          tv_show.append("\n" + "书号:" + cursor.getString(1) + "   书名:"

                 + cursor.getString(2) + "   作者" + cursor.getString(3) + "\n已读:"

                 + cursor.getString(4) + "   总页:" + cursor.getString(5)+ "\n");

       }

       cursor.close();

       db.close();

   }

}

 

 

 

猜你喜欢

转载自www.cnblogs.com/zhangmingzhu/p/12002250.html