Android:安卓开发采用Volley网络框架+MySQL数据库,实现从服务器获取数据并展示完成记单词APP

news/2024/7/5 6:48:58

一、功能与要求

实现功能:设计一个记单词APP。服务器采用Tomcat,数据库采用Mysql。实现用户的注册登录功能以及单词的增删改查。

指标要求:实现UI布局;将系统数据保存到Mysql数据库中,并采用Volley网络框架实现从服务器获取数据并展示。

二 项目实现步骤

步骤1:搭建开发环境。
步骤2:准备资源。
步骤3:UI设计与开发。
步骤4:实现服务器端。
步骤5:实现客户端后台:包括用户的登陆注册及单词的增删改查功能。

三、项目实现

(一)服务器端代码
服务器端核心代码如下:
1.配置数据库代码:
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:
#在映射实体或者属性时,将数据库中表名和字段名中的下划线去掉,按照驼峰命名法映射
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
id-type: ASSIGN_ID
登录界面UI代码:

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

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

四 效果展示

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

数据库表及数据展示

User表:
在这里插入图片描述

在这里插入图片描述

Word表
在这里插入图片描述
在这里插入图片描述

五 总结与收获

通过该项目的设计,掌握Android项目设计开发流程,学会了使用网络框架完成了一款记单词软件,UI布局界面使用了很多控件,使我掌握了TextView、EditText、Button、ratingBar、RadioGroup、radioButton、toggleButton、checkBox、spinner等控件的使用、后台使用了AlertDialog实现了注册按钮弹出对话框。此次项目设计不仅仅使对我技术上的锻炼有所提高,更多的是为我之后的学习奠定了良好的基础,但是依然有很多的不足之处需要我们继续完善和改正。
系统还有很多可以改进的地方,还可以对代码进行进一步改进和优化。在页面上,还不够美观,对于UI设计还有很多需要进一步提升的地方。很多问题都需要我在今后不断学习来解决和完善。
在整个系统的需求分析过程中对开发前期工作地流程步骤有了深入的掌握;在开发过程我进一步学习了Java的基础语法,和一些xml设计美工方面的知识,以便使系统有更好的美观性,在编写过程中也规范了许多编码习惯,数据库设计阶段我学习了Mysql数据库,在一些基本操作上也有了进一步提高。在配置开发工具过程中对Tomcat和IDEA的连接部署有了清晰地认识,在使用第三方插件json进行了其配置也有了相当的了解, 对开发程序的步骤框架有了总体性认识。
在整个系统开发的过程中,我学到了很多新的知识,之前学过的许多知识点在运用过程中也有了更为深入的分析,在这个过程中也体会到了如何将书本知识转化到实际的应用中。
通过本项目的开发,我深入了解了安卓开发、网络请求框架、后台开发和数据库等技术,并且掌握了这些技术的应用方法。在项目开发过程中,我遇到了许多问题,但通过不断地学习和实践,我成功地解决了这些问题,并且取得了不错的成果。通过本项目的开发,我不仅提高了自己的技术水平,也增强了自己的实践能力和团队协作能力。最后,也感谢老师和同学们对我的帮助,我相信这对我今后的工作有很大的帮助。
在今后,我们也将不断学习来提升我们的编码能力和系统分析设计能力,使自己能力得到提高。


http://www.niftyadmin.cn/n/3649622.html

相关文章

Java基础---集合框架四(Map)

2015-4-19 一、Map集合 1、Map接口概述 将键映射到值的对象 一个映射不能包含重复的键 每个键最多只能映射到一个值 2、Map接口和Collection接口的不同 Map是双列的,Collection是单列的 Map的键唯一,Collection的子体系Set是唯一的 Map集合的数据结构值针对键有效&#xff0…

如何在GraphQL和Vue中构建文件处理应用

介绍 (Introduction) In this tutorial, we’ll go over how to handle file uploads in GraphQL by building a full-stack app. This tutorial will be divided into two main sections: building the GraphQL API, and creating the frontend app. The GraphQL API will be …

[J2ME]RSSOwlMidlet(RSS无线阅读器)开源说明

郑昀ultrapower产品名称产品版本Keyword: RssReader RssFeed Channel j2me midp midlet kxml xmlpull RMS RssOwl java RSS无线阅读器0.7.1729[J2ME][开源]RSSOwlMidlet(RSS无线阅读器)开源说明摘要&#xff1a;本文档给出RSS无线阅读器J2ME版本的开源说明。第1章 简单描述RSS…

Android项目实战系列—基于博学谷(七)课程模块(中)

由于这个模块内容较多,分为上、中、下 三篇博客分别来讲述&#xff0c;请耐心阅读。 课程模块分为四个部分 课程列表 课程详情 视频播放 播放记录 课程模块&#xff08;中&#xff09;主要讲述课程详情部分 一、课程详情界面 1、创建课程详情界面 在com.boxuegu.activity包中…

如何在JavaScript中使用解构分配

JavaScript provides you with the ability to destructure objects and assign the individual units in one take. This allows you to get to the point of what you want to do and keep things clean. JavaScript使您能够分解对象并一次性完成分配各个单元的功能。 这使您…

Java基础---集合框架二(ArrayList 接口)

2015-4-16 一、List集合 1、List集合特有方法 特有方法&#xff1a; voidadd(int index, E element) &#xff1a; 在当前集合中指定位置 添加给定的元素 Objectget(int index) 返回集合中指定位置的元素。 intindexOf(Object o)返回此集合中第一次出现的指定元素的索引&…

Java基础---IO流三(字节流 字符流)

2015-04-23 一、转换流&#xff08;IO流续&#xff09; 1、编码表概述 由字符及其对应的数值组成的一张表 编码 把看得懂的变成看不懂的 解码 把看不懂的变成看得懂的 常见的编码表 ASCII&#xff1a;用7位来表示一个数据 ISO-8859-1&#xff1a;在西欧使用&#xff0c;…

Android项目实战系列—基于博学谷(七)课程模块(下)

由于这个模块内容较多,分为上、中、下 三篇博客分别来讲述&#xff0c;请耐心阅读。 课程模块分为四个部分 课程列表 课程详情 视频播放 播放记录 课程模块&#xff08;下&#xff09;主要讲述视频播放和播放记录两个部分 一、视频播放 1、视频播放界面 &#xff08;1&#…