一、功能與要求
實現(xiàn)功能:設計一個記單詞APP。服務器采用Tomcat,數(shù)據(jù)庫采用Mysql。實現(xiàn)用戶的注冊登錄功能以及單詞的增刪改查。
指標要求:實現(xiàn)UI布局;將系統(tǒng)數(shù)據(jù)保存到Mysql數(shù)據(jù)庫中,并采用Volley網(wǎng)絡框架實現(xiàn)從服務器獲取數(shù)據(jù)并展示。
二 項目實現(xiàn)步驟
步驟1:搭建開發(fā)環(huán)境。
步驟2:準備資源。
步驟3:UI設計與開發(fā)。
步驟4:實現(xiàn)服務器端。
步驟5:實現(xiàn)客戶端后臺:包括用戶的登陸注冊及單詞的增刪改查功能。
三、項目實現(xiàn)
(一)服務器端代碼
服務器端核心代碼如下:
1.配置數(shù)據(jù)庫代碼:
server:
port: 8080
spring:
application:
# 應用的名稱,可選
name: reggie_take_out
datasource:
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/readword
username: root
password: 0925
main:
banner-mode: off
mybatis-plus:
configuration:
#在映射實體或者屬性時,將數(shù)據(jù)庫中表名和字段名中的下劃線去掉,按照駝峰命名法映射
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
id-type: ASSIGN_ID
登錄界面UI代碼:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="440dp"
android:layout_marginRight="50dp"
android:orientation="horizontal">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="用戶名稱:"
android:textSize="22sp" />
<EditText
android:id="@+id/editTextTextPersonName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="22sp"
android:hint="請輸入用戶名"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:orientation="horizontal">
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="用戶密碼:"
android:textSize="22sp" />
<EditText
android:id="@+id/editTextTextPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="1"
android:textSize="22sp"
android:inputType="textPassword"
android:hint="輸入六位密碼" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:orientation="horizontal">
<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="10dp"
android:gravity="right"
android:background="#00FFFFFF"
android:text="忘記密碼?"
android:onClick="onClick"
android:textColor="#6B6868"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginRight="50dp"
android:orientation="horizontal">
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="登錄"
android:onClick="onClick"
android:textSize="20sp" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:onClick="onClick"
android:text="注冊"
android:textSize="20sp" />
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="查詢"
android:onClick="onClick"
android:textSize="20sp" />
</LinearLayout>
四 效果展示
數(shù)據(jù)庫表及數(shù)據(jù)展示
User表:
Word表文章來源:http://www.zghlxwxcb.cn/news/detail-540831.html
五 總結與收獲
通過該項目的設計,掌握Android項目設計開發(fā)流程,學會了使用網(wǎng)絡框架完成了一款記單詞軟件,UI布局界面使用了很多控件,使我掌握了TextView、EditText、Button、ratingBar、RadioGroup、radioButton、toggleButton、checkBox、spinner等控件的使用、后臺使用了AlertDialog實現(xiàn)了注冊按鈕彈出對話框。此次項目設計不僅僅使對我技術上的鍛煉有所提高,更多的是為我之后的學習奠定了良好的基礎,但是依然有很多的不足之處需要我們繼續(xù)完善和改正。
系統(tǒng)還有很多可以改進的地方,還可以對代碼進行進一步改進和優(yōu)化。在頁面上,還不夠美觀,對于UI設計還有很多需要進一步提升的地方。很多問題都需要我在今后不斷學習來解決和完善。
在整個系統(tǒng)的需求分析過程中對開發(fā)前期工作地流程步驟有了深入的掌握;在開發(fā)過程我進一步學習了Java的基礎語法,和一些xml設計美工方面的知識,以便使系統(tǒng)有更好的美觀性,在編寫過程中也規(guī)范了許多編碼習慣,數(shù)據(jù)庫設計階段我學習了Mysql數(shù)據(jù)庫,在一些基本操作上也有了進一步提高。在配置開發(fā)工具過程中對Tomcat和IDEA的連接部署有了清晰地認識,在使用第三方插件json進行了其配置也有了相當?shù)牧私? 對開發(fā)程序的步驟框架有了總體性認識。
在整個系統(tǒng)開發(fā)的過程中,我學到了很多新的知識,之前學過的許多知識點在運用過程中也有了更為深入的分析,在這個過程中也體會到了如何將書本知識轉化到實際的應用中。
通過本項目的開發(fā),我深入了解了安卓開發(fā)、網(wǎng)絡請求框架、后臺開發(fā)和數(shù)據(jù)庫等技術,并且掌握了這些技術的應用方法。在項目開發(fā)過程中,我遇到了許多問題,但通過不斷地學習和實踐,我成功地解決了這些問題,并且取得了不錯的成果。通過本項目的開發(fā),我不僅提高了自己的技術水平,也增強了自己的實踐能力和團隊協(xié)作能力。最后,也感謝老師和同學們對我的幫助,我相信這對我今后的工作有很大的幫助。
在今后,我們也將不斷學習來提升我們的編碼能力和系統(tǒng)分析設計能力,使自己能力得到提高。文章來源地址http://www.zghlxwxcb.cn/news/detail-540831.html
到了這里,關于Android:安卓開發(fā)采用Volley網(wǎng)絡框架+MySQL數(shù)據(jù)庫,實現(xiàn)從服務器獲取數(shù)據(jù)并展示完成記單詞APP的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!