本文整理汇总了Java中cn.bmob.v3.BmobSMS类的典型用法代码示例。如果您正苦于以下问题:Java BmobSMS类的具体用法?Java BmobSMS怎么用?Java BmobSMS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BmobSMS类属于cn.bmob.v3包,在下文中一共展示了BmobSMS类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: userLoginByPhone
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
@Override public void userLoginByPhone(final String phone) {
if (!KyPattern.checkPhoneNumber(phone)) {
toastUtil.show("请输入正确的手机号码");
return;
}
final Intent intent = new Intent(this, RequestSMSCodeActivity.class);
intent.putExtra("phone", phone);
BmobSMS.requestSMSCode(phone, "生活服务超市模板", new QueryListener<Integer>() {
@Override public void done(Integer smsId, BmobException ex) {
if (ex != null) {
toastUtil.show("出现未知错误,请重启该应用");
KLog.d(ex.getErrorCode() + ":" + ex.getMessage());
return;
}
startActivityForResult(intent, KySet.USER_REQUEST_PHONE_SIGNUP_OR_LOGIN);
}
});
}
开发者ID:bitkylin,项目名称:BitkyShop,代码行数:22,代码来源:LoginActivity.java
示例2: requestCode
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
public void requestCode() {
String number = _emailText.getText().toString();
if (!TextUtils.isEmpty(number)) {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String sendTime = format.format(new Date());
BmobSMS.requestSMSCode(number, "注册模板", new QueryListener<Integer>() {
@Override
public void done(Integer smsId, BmobException ex) {
if (ex == null) {//验证码发送成功
toast("验证码发送成功,短信id:" + smsId);//用于查询本次短信发送详情
} else {
toast("errorCode = " + ex.getErrorCode() + ",errorMsg = " + ex.getLocalizedMessage());
}
}
});
} else {
toast("请输入手机号码");
}
}
开发者ID:zyfAnd,项目名称:dulife,代码行数:21,代码来源:LoginActivity.java
示例3: verifySmsCode
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
private void verifySmsCode() {
String number = _emailText.getText().toString();
String code = _passwordText.getText().toString();
if (!TextUtils.isEmpty(number) && !TextUtils.isEmpty(code)) {
BmobSMS.verifySmsCode(number, code, new UpdateListener() {
@Override
public void done(BmobException ex) {
if (ex == null) {//短信验证码已验证成功
toast("验证通过");
} else {
toast("验证失败:code =" + ex.getErrorCode() + ",msg = " + ex.getLocalizedMessage());
}
}
});
} else {
toast("请输入手机号和验证码");
}
}
开发者ID:zyfAnd,项目名称:dulife,代码行数:20,代码来源:LoginActivity.java
示例4: requestCode
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
private void requestCode() {
phone = etPhone.getText().toString();
if (TextUtils.isEmpty(phone)) {
etPhone.setError("手机号码不能为空");
return;
}
if (!isPhoneNum(phone)) {
etPhone.setError("手机号码格式不正确");
return;
}
MyCounter counter = new MyCounter(60000, 1000);
counter.start();
BmobSMS.requestSMSCode(phone, "辰言", new QueryListener<Integer>() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
showToast("验证码发送成功!");
} else {
if (e.getErrorCode() == 10010) {
showToast("您请求验证码过去频繁,请于1小时候重试");
} else {
showToast("验证码发送失败" + e.getErrorCode() + e.getMessage());
}
}
}
});
}
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:29,代码来源:RegisterActivity.java
示例5: requestVerify
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
public void requestVerify(Context context, String num, String template){
BmobSMS.requestSMSCode(context, num, template, new RequestSMSCodeListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
Log.i(TAG, integer.toString());
ExUtils.Toast("发送成功");
} else {
ExUtils.Toast("发送失败");
}
}
});
}
开发者ID:Fukago,项目名称:TravelBan,代码行数:14,代码来源:AccountModel.java
示例6: verify
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
public void verify(Context context, String num, String smsCode){
BmobSMS.verifySmsCode(context, num, smsCode, new VerifySMSCodeListener() {
@Override
public void done(BmobException e) {
if (e == null) {
mIVerifyListener.onVerifySuccess();
ExUtils.Toast("验证成功");
} else {
ExUtils.Toast("验证失败,请核实验证码或退出重试");
}
}
});
}
开发者ID:Fukago,项目名称:TravelBan,代码行数:14,代码来源:AccountModel.java
示例7: processClick
import cn.bmob.v3.BmobSMS; //导入依赖的package包/类
@Override
public void processClick(View v) {
switch (v.getId()) {
case R.id.btn_getSmsCode:
telNumString = mEdtNum.getText().toString();
isTel = verifyTel(telNumString);
if (!TextUtils.isEmpty(telNumString) && isTel) {
loadSMS();
BmobSMS.requestSMSCode(telNumString, BmobConfig.SMSTEMPLATE, new QueryListener<Integer>() {
@Override
public void done(Integer smsCode, BmobException e) {
if (e == null) {
ToastUtils.showToast(RegisterOrResetActivity.this, "验证码发送完毕");
} else {
ToastUtils.showToast(RegisterOrResetActivity.this, "验证码发送失败:"+e.getMessage());
}
}
});
} else {
ToastUtils.showToast(this, "请正确输入手机号");
}
break;
case R.id.btn:
telNumString = mEdtNum.getText().toString();
smsCodeString = mEdtSmsCode.getText().toString();
passwordString = mEdtPassword.getText().toString();
rePassWordString = mEdtRePassword.getText().toString();
isTel = verifyTel(telNumString); //判断是否为正确的手机号
isTruePassword = verifyTwoPassword(passwordString, rePassWordString);//进行两次输入的密码校验
if (sign == 0) {
registerUser();
} else if (sign == 1) {
resetPassword();
}
break;
}
}
开发者ID:monsterLin,项目名称:Pigeon,代码行数:45,代码来源:RegisterOrResetActivity.java
注:本文中的cn.bmob.v3.BmobSMS类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论