基于 Android Studio 实现猫眼电影App 2.0(电影购票)

目录

前言

一、任务介绍

二、 实现介绍

视频演示

Get 项目模板源码


非原创项目:网络资源模板--基于 Android Studio 实现的电影购票App

原创猫眼1.0: 基于Android Studio 实现仿猫眼电影APP 1.0

前言

        随着智能手机的普及和移动互联网的发展,移动应用不断涌现,其中包括许多电影相关的应用。猫眼App是中国一款非常受欢迎的电影资讯和票务平台,为用户提供了电影排片信息、购买电影票等功能,深受用户喜爱。

一、任务介绍

1.1 背景

        随着智能手机的普及和移动互联网的发展,移动应用不断涌现,其中包括许多电影相关的应用。猫眼App是中国一款非常受欢迎的电影资讯和票务平台,为用户提供了电影排片信息、购买电影票等功能,深受用户喜爱。    

1.2目的和意义

        开发这个仿猫眼App的目的是为了提供一个便捷的电影票务平台,满足用户对于查看电影、获取电影信息以及在线购票的需求。通过该应用,用户可以方便地浏览电影的热映、即将上映等信息,并且能够在线查看各个影院的排片情况,方便选择合适的场次进行购票。

二、 实现介绍

视频演示

基于 Android Studio 实现猫眼电影App 2.0 (电影购票)

2.1 启动页实现

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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/start"
    tools:context=".Start.StartActivity">

</androidx.constraintlayout.widget.ConstraintLayout>

2.2 注册页面实现

1. 获取用户名、密码和重复密码的输入内容。

2. 检查用户名和密码是否为空,如果为空则显示一个 Toast 提示用户输入账号或密码,并结束方法的执行。

3. 检查两次输入的密码是否一致,如果一致则执行以下操作:

   a. 调用 mDatabaseHelper 的 insertData 方法将用户名和密码插入数据库。

   b. 如果插入成功,则显示一个注册成功的 Toast 提示,并跳转到登录页面,最后关闭当前页面。

   c. 如果插入失败,则显示一个注册失败的 Toast 提示。

4. 如果两次输入的密码不一致,则显示一个 Toast 提示用户两次密码不同。

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="#fff"
    tools:context=".Register.RegisterActivity">

    <EditText
        android:id="@+id/username_edittext"
        android:layout_width="310dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="40dp"
        android:hint="请输入账号"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/imageView2" />

    <EditText
        android:id="@+id/password_edittext"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:hint="请输入密码"
        android:inputType="textPassword"
        app:layout_constraintEnd_toEndOf="@+id/username_edittext"
        app:layout_constraintStart_toStartOf="@+id/username_edittext"
        app:layout_constraintTop_toBottomOf="@+id/username_edittext" />

    <EditText
        android:id="@+id/repeat"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:ems="10"
        android:hint="再次输入您的密码"
        android:inputType="textPassword"
        app:layout_constraintEnd_toEndOf="@+id/username_edittext"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="@+id/username_edittext"
        app:layout_constraintTop_toBottomOf="@+id/password_edittext" />

    <TextView
        android:id="@+id/tv_login"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:text="已有账号?立即登录"
        app:layout_constraintStart_toStartOf="@+id/repeat"
        app:layout_constraintTop_toBottomOf="@+id/repeat" />

    <Button
        android:id="@+id/rEgisterTv"
        android:layout_width="280dp"
        android:layout_height="50dp"
        android:layout_marginTop="50dp"
        android:background="@drawable/login_view"
        android:text="注 册"
        android:textColor="#fff"
        android:textSize="20sp"
        app:layout_constraintEnd_toEndOf="@+id/repeat"
        app:layout_constraintHorizontal_bias="0.466"
        app:layout_constraintStart_toStartOf="@+id/repeat"
        app:layout_constraintTop_toBottomOf="@+id/tv_login" />

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="150dp"
        android:layout_height="150dp"
        android:layout_marginTop="50dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/logo" />
</androidx.constraintlayout.widget.ConstraintLayout>

2.3 登陆页面实现

1. 获取用户名和密码的输入内容。

2. 检查用户名和密码是否为空,如果为空则显示一个 Toast 提示用户输入账号或密码,并结束方法的执行。

3. 调用 mDatabaseHelper 的 checkUser 方法来检查用户名和密码是否匹配。

4. 如果匹配成功,则显示一个登录成功的 Toast 提示,并跳转到主页面 MainActivity。

5. 如果匹配失败,则显示一个账号或密码错误的 Toast 提示。

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="#fff"
    tools:context=".Login.LoginActivity">

    <EditText
        android:id="@+id/password_edittext"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:hint="请输入密码"
        android:inputType="textPassword"
        app:layout_constraintEnd_toEndOf="@+id/username_edittext"
        app:layout_constraintStart_toStartOf="@+id/username_edittext"
        app:layout_constraintTop_toBottomOf="@+id/username_edittext" />

    <Button
        android:id="@+id/login_button"
        android:layout_width="280dp"
        android:layout_height="50dp"
        android:layout_marginTop="70dp"
        android:background="@drawable/login_view"
        android:text="登 陆"
        android:textColor="#fff"
        android:textSize="20sp"
        app:layout_constraintEnd_toEndOf="@+id/password_edittext"
        app:layout_constraintHorizontal_bias="0.478"
        app:layout_constraintStart_toStartOf="@+id/password_edittext"
        app:layout_constraintTop_toBottomOf="@+id/textView2" />

    <EditText
        android:id="@+id/username_edittext"
        android:layout_width="310dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="60dp"
        android:hint="请输入账号"
        app:layout_constraintEnd_toEndOf="@+id/imageView"
        app:layout_constraintStart_toStartOf="@+id/imageView"
        app:layout_constraintTop_toBottomOf="@+id/imageView" />

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="150dp"
        android:layout_height="150dp"
        android:layout_marginTop="60dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.498"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/logo" />

    <TextView
        android:id="@+id/rEgisterTv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:text="还没账号?立即注册"
        android:textColor="#000"
        app:layout_constraintEnd_toEndOf="@+id/password_edittext"
        app:layout_constraintTop_toBottomOf="@+id/password_edittext" />

    <TextView
        android:id="@+id/textView2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="忘记密码"
        android:textColor="#000"
        app:layout_constraintBottom_toBottomOf="@+id/rEgisterTv"
        app:layout_constraintStart_toStartOf="@+id/password_edittext"
        app:layout_constraintTop_toTopOf="@+id/rEgisterTv" />

</androidx.constraintlayout.widget.ConstraintLayout>

2.4 首页实现

  首页主要实现轮播图功能,电影的分类显示

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="#f1f1f1"
    tools:context=".MainActivity">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <androidx.constraintlayout.widget.Guideline
                android:id="@+id/guideline"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                app:layout_constraintGuide_percent="0.05" />

            <androidx.constraintlayout.widget.Guideline
                android:id="@+id/guideline2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                app:layout_constraintGuide_percent="0.95" />

            <com.youth.banner.Banner
                android:id="@+id/banner"
                android:layout_width="0dp"
                android:layout_height="140dp"
                android:layout_marginTop="8dp"
                app:layout_constraintEnd_toStartOf="@+id/guideline2"
                app:layout_constraintStart_toStartOf="@+id/guideline"
                app:layout_constraintTop_toTopOf="parent">

            </com.youth.banner.Banner>

            <View
                android:id="@+id/view"
                android:layout_width="0dp"
                android:layout_height="256dp"
                android:layout_marginTop="8dp"
                android:background="@drawable/main_view"
                app:layout_constraintEnd_toStartOf="@+id/guideline2"
                app:layout_constraintStart_toStartOf="@+id/guideline"
                app:layout_constraintTop_toBottomOf="@+id/banner" />

            <LinearLayout
                android:layout_width="357dp"
                android:layout_height="240dp"
                android:orientation="vertical"
                app:layout_constraintEnd_toStartOf="@+id/guideline2"
                app:layout_constraintStart_toStartOf="@+id/guideline"
                app:layout_constraintTop_toTopOf="@+id/view">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:id="@+id/textView3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="16dp"
                        android:layout_marginTop="8dp"
                        android:text="正在热映"
                        android:textColor="#000"
                        android:textSize="18sp"
                        android:textStyle="bold" />

                </LinearLayout>

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/rv_hot"
                    android:layout_width="350dp"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="3dp" />
            </LinearLayout>

            <View
                android:id="@+id/view2"
                android:layout_width="0dp"
                android:layout_height="250dp"
                android:layout_marginTop="8dp"
                android:background="@drawable/main_view"
                app:layout_constraintEnd_toStartOf="@+id/guideline2"
                app:layout_constraintHorizontal_bias="0.0"
                app:layout_constraintStart_toStartOf="@+id/guideline"
                app:layout_constraintTop_toBottomOf="@+id/view" />

            <TextView
                android:id="@+id/textView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:layout_marginTop="8dp"
                android:text="即将上映"
                android:textColor="#000"
                android:textSize="18sp"
                android:textStyle="bold"
                app:layout_constraintStart_toStartOf="@+id/guideline"
                app:layout_constraintTop_toTopOf="@+id/view2" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/rv_future"
                android:layout_width="350dp"
                android:layout_height="220dp"
                android:orientation="horizontal"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                app:layout_constraintEnd_toStartOf="@+id/guideline2"
                app:layout_constraintStart_toStartOf="@+id/guideline"
                app:layout_constraintTop_toBottomOf="@+id/textView"
                tools:listitem="@layout/tobeshown_item">

            </androidx.recyclerview.widget.RecyclerView>

            <ImageView
                android:id="@+id/imageView4"
                android:layout_width="10dp"
                android:layout_height="10dp"
                android:layout_marginTop="24dp"
                android:layout_marginEnd="20dp"
                app:layout_constraintEnd_toStartOf="@+id/guideline2"
                app:layout_constraintTop_toBottomOf="@+id/banner"
                app:srcCompat="@drawable/jiantou" />

            <TextView
                android:id="@+id/tv_all"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="3dp"
                android:text="查看全部"
                android:textColor="#000"
                android:textSize="15sp"
                app:layout_constraintBottom_toBottomOf="@+id/imageView4"
                app:layout_constraintEnd_toStartOf="@+id/imageView4"
                app:layout_constraintTop_toTopOf="@+id/imageView4" />

        </androidx.constraintlayout.widget.ConstraintLayout>
    </ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>

2.5 正在热映页面实现

1. 通过 `getIntent()` 方法获取传递的 JSON 字符串,并将其存储在 `hotJson` 变量中。

2. 使用 Gson 将 JSON 字符串转换为 `Hot` 对象。

3. 使用图片加载库(如 Glide)加载图片,并显示在 `img` 控件上。

4. 将 `Hot` 对象的属性值分别设置到对应的控件上,如 `nm` 控件显示电影名称、`scm` 控件显示电影副标题等。

5. 创建一个 `ProgressDialog` 对象并设置加载提示信息为 "视频加载中...",并设置其不可取消。

6. 调用 `playVideo` 方法,并传入 `Hot` 对象的视频链接地址作为参数,以播放视频。

2.6即将上映页面实现

1. 通过 `getIntent()` 方法获取传递的 JSON 字符串,并将其存储在 `toBeShown` 变量中。

2. 使用 Gson 将 JSON 字符串转换为 `ToBeShown` 对象。

3. 使用图片加载库(如 Glide)加载图片,并显示在 `img` 控件上。

4. 将 `ToBeShown` 对象的属性值分别设置到对应的控件上,如 `nm` 控件显示名称、`star` 控件显示演员、`showInfo` 控件显示信息等。

5. 设置 `version` 控件显示版本信息。

6. 设置 `sc` 控件显示评分信息。

7. 设置 `wish` 控件显示想看人数信息。

2.7 购票页面

 在这里我们可以对电影票进行选座,选择支付方式,这里是每个用户对应每个用户的信息,电影票座位是公用的,所有人都可以查看到!

2.8 我的订单

 在这里我们可以对购买的电影票进行退票、转让操作。

2.9 我的页面

这里我们做了优化和功能增加。 

2.10 修改密码

这里我们显示了登录的用户名,然后根据旧密码来修改新密码。 

2.11 预约

该页面就是我们之前点击预约的内容,长安列表项即可删除该预约信息。

到此为止我们的项目介绍就已经完成了!

Get 项目模板源码

👇👇👇快捷获取方式👇👇👇

  • 17
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
安卓Android电影院订票app设计可升级Studio 开发环境: Myclipse/Eclipse/Idea都可以(服务器端) + Eclipse(手机客户端) + mysql数据库 系统客户端和服务器端架构技术: 界面层,业务逻辑层,数据层3层分离技术,MVC设计思想! 服务器和客户端数据通信格式: XML格式(用于传输查询的记录集)和json格式(用于传输单个的对象信息) 影院系统在电影院有着重要的地位,它不仅保存着电影院的基本信息,而且会储存大量的用户个人信息。影院系统是电影院重要的组成部分,在有效管理电影信息的同时,对电影院的业务和模式以及统筹计划起着至关重要的作用。 本系统根据电影院的实际要求,结合考察电影院管理的实际流程,需要实现以下的功能。 客户端: 1.注册功能:新用户可以在手机端注册。 2登录功能:输入账号和密码,进行登录操作。 3.查询影片信息:选择相应的影片,查询影片的相关内容。 4.订票:选择相应的影片,订取该影片的影票。 5.关于:查看本软件的相关信息。 6.退出:退出当前登录。 服务器端: 1.影院信息:添加各电影院的基本信息,让用户可以看到该影院的影片资讯,并可以对其进行删除修改等操作。 2.影片信息:对上映的电影进行详细介绍,对播放地区、时间、是否推荐、上映影院进行增添、删除、修改等操作。 3.用户信息:对用户的个人信息进行浏览,并且可以对其进行管理。 实体ER属性: 用户: 用户名,登录密码,姓名,性别,出生日期,用户照片,联系电话,邮箱,家庭地址,注册时间 电影类型: 类型id,类型名称 电影: 电影id,影片类型,影片名称,影片图片,导演,主演,时长,地区,放映时间,票价,剧情简介,是否推荐,点击率 地区: 地区id,地区名称 订单: 订单编号,下单电影,电影价格,购买数量,订单总价,下单用户,下单时间,收货人,收货人电话,收货人地址,订单状态,订单备注 订单状态: 订单状态id,订单状态名称 -------- 不懂运行,下载完可以私聊问,可远程教学 该资源内项目源码是个人的毕设,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! <项目介绍> 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。 --------
好的,下面是一个简单的电影购票App实现步骤: 1.设计应用程序的界面 首先你需要设计应用程序的界面。你可以使用Android Studio提供的布局编辑器,或者手动编写XML代码来设计应用程序的界面。你需要考虑到显示电影信息、影院信息、座位预订等方面的界面设计。 2.与服务器端交互 你需要与服务器端进行交互,以获取电影信息、影院信息、座位预订等数据。你可以使用HTTP协议与服务器进行通信,获取JSON格式的数据,然后解析这些数据并显示在应用程序的界面上。 3.实现用户登录和注册功能 你需要实现用户登录和注册功能,以便用户可以登录并预定电影票。你可以使用SQLite数据库存储用户信息,或者将用户信息存储在服务器端。 4.实现座位预订功能 用户可以选择电影和影院,并选择座位进行预订。你需要实现座位预订功能,以便用户可以选择座位,并将预订信息发送到服务器端。 5.实现支付功能 用户需要支付购买的电影票,你需要实现支付功能,以便用户可以使用支付宝、微信等支付方式进行支付。 6.测试和发布应用程序 完成应用程序的开发后,你需要对应用程序进行测试,并发布应用程序到各大应用市场。 以上就是一个简单的电影购票App实现步骤。当然,具体的实现步骤可能会因为需求的不同而有所变化,但是这个步骤可以作为一个参考。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

编程乐学

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

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

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

打赏作者

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

抵扣说明:

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

余额充值