一、 課程設計概述
1.1任務背景
學生信息管理是學校管理中異常重要的一個環節,作為學校,除了育人,就是育知,學生信息管理的計算機化是整個學校教務管理中的重要一部分,能否實現這一步關系到學校辦學整體效率的高低,由於它的重要性,學生信息管理系統的開發與應用就逐漸提入議程,並占着越來越重要的份量。 運用學生信息管理系統可以減輕學院教學人員的工作量,縮小開支,提高工作效率與准確率,能夠合理安排時間,能夠盡快的知道自己的考試成績,投入新的課程的學習或復習這次沒有考過的課程。而學生信息管理系統的應用也為今天的民辦教育在未來市場的競爭力有所提高。從大的方向說,就是為了加速我國四化建設的發展,實現全部的自動化,使我國發展成為通訊網絡化,決策科學化,辦公自動化的國家。 在現代,高科技的飛躍發展,人們工作習慣的改變,特別是電腦的大量普及,人們生活節奏越來越快,怎樣提高工作效率是人們首先考慮的問題。學生信息管理是一個非常繁瑣與復雜的一項工作,一個原因就是工作量大不好管。對於一個學校而言,更應該運用一些本地資源,提高管理的力度,對學生負責,對國家負責。
開發學生信息管理系統手機客戶端旨在方便管理學生信息,使同學android智能手機就可以管理學生信息,真正做到互聯網的全方位覆蓋。管理學生信息系統適用於具有android智能手機的用戶,在使用本軟件后,學生信息管理將更加方便快捷。
1.2開發環境
開發環境:eclipse
運行環境:Android智能手機
二 需求分析
2.1功能需求
本系統扮演着提供用戶直接查詢業務的重要角色。它主要提供友好的、方便的用戶操作界面。接受用戶的注冊、各項查詢以及密碼的修改,具體的功能如下:
用戶功能:
1.查詢信息功能:管理員通過登陸賬戶密碼,可以查看所有用戶信息。
2增加信息功能:管理員可以增加用戶。
3.修改信息功能:管理員可以修改用戶注冊的信息。
4.刪除信息功能:管理員可以刪除用戶注冊的信息
2.2 UML需求用例圖
UML需求用例圖
三 系統設計與實現
3.1系統總體設計
系統數據流程圖如下圖所示:
圖3.1 學生管理系統數據流圖
3.2 數據庫設計與實現
3.2.1數據庫E-R圖
學生信息窗口中包括姓名、性別、民族、學號、備注、電話、生日,詳細如圖3.2數據庫E-R圖:
3.3 功能詳細設計與實現
3.3.1 注冊界面
3.3.2 登錄界面
3.3.3 查詢界面
3.3.4 添加界面
3.3.5 刪除界面
3.4 開發源代碼
<RelativeLayout 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/bg" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity"> <AutoCompleteTextView //建立輸入用戶名文本框 android:id="@+id/userName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/textView2" android:layout_alignBottom="@+id/textView2" android:layout_alignRight="@+id/userPassword" android:layout_toRightOf="@+id/textView2" android:ems="10" android:hint="請輸入用戶名" /> <EditText //建立密碼文本框 android:id="@+id/userPassword" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/textView1" android:layout_toRightOf="@+id/textView2" android:ems="10" android:hint="請輸入密碼" android:inputType="textPassword" /> <TextView // android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignRight="@+id/textView2" android:layout_below="@+id/userName" android:layout_marginTop="21dp" android:text="密 碼:" android:textColor="#ffffff" android:textSize="20sp" /> <Button //建立注冊按鈕 android:id="@+id/register" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/login" android:layout_alignBottom="@+id/login" android:layout_alignLeft="@+id/textView1" android:text="注冊" android:background="@drawable/login_btn_click" /> <Button //退出按鈕 android:id="@+id/exit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignRight="@+id/userPassword" android:layout_below="@+id/userPassword" android:layout_marginTop="42dp" android:text="退出" android:background="@drawable/login_btn_click" /> <TextView //輸入用戶名文本框 android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/imageView1" android:layout_marginLeft="22dp" android:layout_marginTop="50dp" android:text="用戶名:" android:textColor="#ffffff" android:textSize="20sp" /> <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="72dp" android:src="@drawable/student" /> <Button android:id="@+id/login" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/exit" android:layout_alignBottom="@+id/exit" android:layout_alignRight="@+id/imageView1" android:background="@drawable/login_btn_click" android:text="登錄" /> </RelativeLayout>
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="用戶名 :" /> <EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="請輸入用戶名" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="密 碼:" /> <EditText android:id="@+id/editText2" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="請輸入密碼" android:inputType="textPassword" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="確認密碼:" /> <EditText android:id="@+id/editText3" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="請再輸入密碼" android:inputType="textPassword" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <Button //確認按鈕 android:id="@+id/btn_confirm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/login_btn_click" android:text="確認" /> <Button //返回按鈕 android:id="@+id/btn_back" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/login_btn_click" android:text="返回" /> </LinearLayout> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <Button //完成按鈕 android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="完成" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="取消" /> </LinearLayout> </LinearLayout>
四、系統測試
4.1測試環境
測試環境即測試的實施環境,包括:
1.軟件測試設計環境:編制測試計划說明等有關文件所基於的設備和支持。
2.軟件測試實施環境:對軟件系統進行各級測試所基於的軟、硬件設備和支持。
3.軟件測試管理環境:管理測試資源所基於的軟、硬件設備和支持
本系統主要使用的是Eclipse(一個開放源代碼的、基於 Java 的可擴展開發平台)以及Android手機。
4.2模塊測試
4.2.1 注冊模塊測試
注冊時需要輸入用戶名、密碼、確定密碼。如果該用戶名已被存在或者兩次密碼輸入不一樣,測試結果如下圖:
用戶已被注冊圖
兩次密碼不一樣圖
注冊成功圖
4.2.2 用戶登錄模塊測試
用戶登錄模塊需要輸入用戶名以及密碼,否則不能登錄並有請輸入用戶名的提示。若登錄時用戶名和密碼錯誤,則會提示您輸入的用戶名或密碼錯誤,否則提示成功。如下圖:
4.2.4 用戶增添模塊測試
輸入用戶信息,對用戶模塊測試,如下圖:
用戶添加信息圖
成功添加用戶圖
五、項目總結
這個程序作完不難,關鍵是調試,修改的過程很難。還有一點,一個細心的人作程序可能少走彎路。一般作程序不是從頭到尾作完再調試,這樣很難調好,因為每編一句都可能出錯,這樣錯誤越積越多,最好的方法是每作完一個小段調試一次,一步一步循序漸進地作完,到最后不至於出了很多錯誤,不知如何尋找,同樣少了很多的麻煩。編程多了,自然地經驗多了,調程序就不覺得那么難了。
要想編好、快速完成任務,就必須有嚴謹的科學態度,比如說一個字母,甚至一個標點符號的錯誤都會導致錯誤,這種錯誤在編程中我們經常出現,有時系統能讓你很快找出,你能順利往下進行,但有時它提示的錯誤信息和標點一點關系都沒有,而后你把編的程序從頭到尾看了一遍, 結果花了大量的時間, 大大降低了效率。其它的粗心大意錯誤更是五花八門,調試起來就更加困難了,所以在編程時一定要心細。編程要有耐心,因為編程是件很繁瑣的工作,如果沒有耐心恐怕是編不下去的,比如有的人,有好幾處錯誤,就放棄了,結果一事無成。
最后一點,就是編程時思路一定要清楚。因為編程本身就是一個嚴密的邏輯過程,實現每一步的操作需要那些命令,哪些條件都是清清楚楚,明明了了的,來不得半點遺漏。
總的來說,編程是件復雜的腦力勞動,要有科學嚴謹的科學態度,細心的習慣和耐心才能作好,要做到以上的要求我們還要做許多許多。
在課程設計的過程中,我遇到了很多問題,通過查閱參考書和老師的指導,都得到了解決。這不僅僅鍛煉了我分析問題和解決問題的能力,也使我意識到自己對知識的了解程度遠了,知識的缺乏也在很多方面。以后我一定會努力提高自己的理論水平,同時盡可能多地讀一些科學書籍,提高自己的理論水平和動手實踐能力。由於時間的限制,解決這個問題和本文不能被稱為完美。在許多地方還有待闡述,修改和完善。