没有合适的资源?快使用搜索试试~ 我知道了~
Android开发中通过手机号+短信验证码登录的实例代码
5星 · 超过95%的资源 39 下载量 128 浏览量
2020-08-30
12:41:36
上传
评论 1
收藏 56KB PDF 举报
温馨提示
试读
4页
最近在开发一个android的项目,需要通过获取手机验证码来完成登录功能,接下来通过实例代码给大家分享手机号+短信验证码登录的实现方法,需要的的朋友参考下吧
资源推荐
资源详情
资源评论
Android开发中通过手机号开发中通过手机号+短信验证码登录的实例代码短信验证码登录的实例代码
最近在开发一个android的项目,需要通过获取手机验证码来完成登录功能,接下来通过实例代码给大家分享手
机号+短信验证码登录的实现方法,需要的的朋友参考下吧
首先,需要一个电话号码,目前很多账户都是将账户名设置成手机号,然后点击按钮获取手机验证码。
其次,你需要后台给你手机短信的验证接口,各个公司用的不一样,这个身为前端,不需要你来考虑,你只要让你后台给你写
好接口,你直接调用就好了。
activity_login.xml
<?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="60dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:gravity="center"
android:orientation="horizontal">
<EditText
android:id="@+id/mobile_login"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:hint="请输入您的手机号"
android:textSize="16sp"
android:background="@null"
android:inputType="number"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:gravity="center"
android:orientation="horizontal">
<EditText
android:id="@+id/yanzhengma"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="4"
android:background="@null"
android:layout_marginLeft="10dp"
android:hint="请输入验证码"
android:textSize="16sp"
android:inputType="number"
/>
<Button
android:id="@+id/getyanzhengma1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.9"
android:textSize="13sp"
android:gravity="center"
android:text="获取验证码"
android:layout_gravity="center"
/>
</LinearLayout>
<Button
android:id="@+id/login_btn"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="登录"
android:textSize="16sp"
/>
</LinearLayout>
资源评论
- m0_713319512022-05-25没有手机卡只有号码的情况下可以接受验证码吗?留个联系方式
weixin_38622827
- 粉丝: 4
- 资源: 905
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Screenshot_20240427_031602.jpg
- 网页PDF_2024年04月26日 23-46-14_QQ浏览器网页保存_QQ浏览器转格式(6).docx
- 直接插入排序,冒泡排序,直接选择排序.zip
- 在排序2的基础上,再次对快排进行优化,其次增加快排非递归,归并排序,归并排序非递归版.zip
- 实现了7种排序算法.三种复杂度排序.三种nlogn复杂度排序(堆排序,归并排序,快速排序)一种线性复杂度的排序.zip
- 冒泡排序 直接选择排序 直接插入排序 随机快速排序 归并排序 堆排序.zip
- 课设-内部排序算法比较 包括冒泡排序、直接插入排序、简单选择排序、快速排序、希尔排序、归并排序和堆排序.zip
- Python排序算法.zip
- C语言实现直接插入排序、希尔排序、选择排序、冒泡排序、堆排序、快速排序、归并排序、计数排序,并带图详解.zip
- 常用工具集参考用于图像等数据处理
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功