基于Android平台开发,校园二手交易app端(一)

1. 功能模块思维导图

在这里插入图片描述

2. 项目涉及到的技术点

  1. 使用CountDownTimer实现欢迎页倒计时
  2. 使用okhttp实现网络请求(springboot搭建服务端)
  3. 使用glide实现图片加载
  4. 使用gson实现json数据解析
  5. 使用banner实现首页轮播图
  6. 使用BottomNavigationView实现底部导航栏
  7. 使用TabLayout+ViewPager2实现滑动分类
  8. 使用RecyclerView实现商品,订单等列表
  9. 使用pictureselector实现本地图库图片选择

3. 开发环境

app安卓端

  1. 开发工具:Androidstudio(版本不是很低就行)
  2. 开发语言:Java
  3. jdk版本:11+以上

服务端

  1. 开发工具:IDEA
  2. 开发语言:Java
  3. jdk版本:11+以上
  4. MySQL数据库:8.0+y以上

4. 运行效果图

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

5. 部分代码实现

  1. 注册activity.register.xml布局页面
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat 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:orientation="vertical">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/teal_200"
        app:navigationIcon="@mipmap/img_back"
        app:title="用户注册"
        app:titleTextColor="@color/white" />


    <androidx.cardview.widget.CardView
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="100dp"
        app:cardCornerRadius="40dp"
        app:cardElevation="0dp">

        <androidx.appcompat.widget.AppCompatImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@mipmap/app_logo" />
    </androidx.cardview.widget.CardView>


    <androidx.appcompat.widget.LinearLayoutCompat
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="20dp"
        android:layout_marginTop="50dp"
        android:layout_marginRight="20dp"
        android:orientation="vertical">

        <androidx.cardview.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="50dp"
            app:cardBackgroundColor="#f5f5f5"
            app:cardCornerRadius="25dp"
            app:cardElevation="0dp">

            <androidx.appcompat.widget.LinearLayoutCompat
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingLeft="10dp"
                android:paddingRight="10dp">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:gravity="center"
                    android:text="用户名:"
                    android:textColor="@color/text_color" />


                <EditText
                    android:id="@+id/username"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="10dp"
                    android:background="@null"
                    android:hint="请输入用户名"
                    android:textSize="14sp" />


            </androidx.appcompat.widget.LinearLayoutCompat>


        </androidx.cardview.widget.CardView>

        <androidx.cardview.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_marginTop="10dp"
            app:cardBackgroundColor="#f5f5f5"
            app:cardCornerRadius="25dp"
            app:cardElevation="0dp">

            <androidx.appcompat.widget.LinearLayoutCompat
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingLeft="10dp"
                android:paddingRight="10dp">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:gravity="center"
                    android:text="手机号:"
                    android:textColor="@color/text_color" />


                <EditText
                    android:id="@+id/mobile"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="10dp"
                    android:background="@null"
                    android:hint="请输入手机号"
                    android:inputType="number"
                    android:maxLength="11"
                    android:textSize="14sp" />


            </androidx.appcompat.widget.LinearLayoutCompat>


        </androidx.cardview.widget.CardView>


        <androidx.cardview.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_marginTop="10dp"
            app:cardBackgroundColor="#f5f5f5"
            app:cardCornerRadius="25dp"
            app:cardElevation="0dp">

            <androidx.appcompat.widget.LinearLayoutCompat
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingLeft="10dp"
                android:paddingRight="10dp">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:gravity="center"
                    android:text="密码:"
                    android:textColor="@color/text_color" />


                <EditText
                    android:id="@+id/password"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="10dp"
                    android:background="@null"
                    android:hint="请输入密码"
                    android:inputType="number"
                    android:maxLength="11"
                    android:textSize="14sp" />


            </androidx.appcompat.widget.LinearLayoutCompat>


        </androidx.cardview.widget.CardView>


        <androidx.cardview.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_marginTop="20dp"
            app:cardBackgroundColor="@color/teal_200"
            app:cardCornerRadius="25dp"
            app:cardElevation="0dp">


            <Button
                android:id="@+id/register"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/teal_200"
                android:text="注册" />


        </androidx.cardview.widget.CardView>


    </androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>

效果图
在这里插入图片描述
2. 登录activity_login.xml布局页面

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:orientation="vertical"
    tools:context="com.school.trading.activity.UserLoginActivity">


    <androidx.appcompat.widget.LinearLayoutCompat
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <androidx.appcompat.widget.Toolbar
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/teal_200"
            app:title="用户登录"
            app:titleTextColor="@color/white">


        </androidx.appcompat.widget.Toolbar>


        <androidx.cardview.widget.CardView
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="100dp"
            app:cardCornerRadius="40dp"
            app:cardElevation="0dp">

            <androidx.appcompat.widget.AppCompatImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@mipmap/app_logo" />
        </androidx.cardview.widget.CardView>


        <androidx.appcompat.widget.LinearLayoutCompat
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_marginTop="50dp"
            android:layout_marginRight="20dp"
            android:orientation="vertical">

            <androidx.cardview.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="50dp"
                app:cardBackgroundColor="#f5f5f5"
                app:cardCornerRadius="25dp"
                app:cardElevation="0dp">

                <androidx.appcompat.widget.LinearLayoutCompat
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:paddingLeft="10dp"
                    android:paddingRight="10dp">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:gravity="center"
                        android:text="用户名:"
                        android:textColor="@color/text_color" />


                    <EditText
                        android:id="@+id/username"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginLeft="10dp"
                        android:background="@null"
                        android:hint="请输入用户名"
                        android:textSize="14sp" />


                </androidx.appcompat.widget.LinearLayoutCompat>


            </androidx.cardview.widget.CardView>


            <androidx.cardview.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:layout_marginTop="10dp"
                app:cardBackgroundColor="#f5f5f5"
                app:cardCornerRadius="25dp"
                app:cardElevation="0dp">

                <androidx.appcompat.widget.LinearLayoutCompat
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:paddingLeft="10dp"
                    android:paddingRight="10dp">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="match_parent"
                        android:gravity="center"
                        android:text="密码:"
                        android:textColor="@color/text_color" />


                    <EditText
                        android:id="@+id/password"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginLeft="10dp"
                        android:background="@null"
                        android:hint="请输入密码"
                        android:inputType="textPassword"
                        android:textSize="14sp" />


                </androidx.appcompat.widget.LinearLayoutCompat>


            </androidx.cardview.widget.CardView>


            <CheckBox
                android:id="@+id/checkbox"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="记住密码"/>

            <androidx.cardview.widget.CardView
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:layout_marginTop="20dp"
                app:cardBackgroundColor="@color/teal_200"
                app:cardCornerRadius="25dp"
                app:cardElevation="0dp">


                <Button
                    android:id="@+id/login"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@color/teal_200"
                    android:text="登录" />


            </androidx.cardview.widget.CardView>

            <TextView
                android:id="@+id/register"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:backgroundTint="@color/white"
                android:padding="10dp"
                android:text="还未注册?"
                android:textColor="@color/teal_200" />


        </androidx.appcompat.widget.LinearLayoutCompat>

    </androidx.appcompat.widget.LinearLayoutCompat>

</RelativeLayout>

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

6. 部分视频教程

  1. Androidstudio底部导航栏实现:https://www.bilibili.com/video/BV1XB4y1d7et/?vd_source=984bb03f768809c7d33f20179343d8c8

  2. Androidstudio登录注册UI实现: https://www.bilibili.com/video/BV14u411T7Y7/?vd_source=984bb03f768809c7d33f20179343d8c8

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

浩宇软件开发

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值