当前位置: 首页>>代码示例>>Java>>正文


Java SMSSDK.EVENT_GET_VERIFICATION_CODE属性代码示例

本文整理汇总了Java中cn.smssdk.SMSSDK.EVENT_GET_VERIFICATION_CODE属性的典型用法代码示例。如果您正苦于以下问题:Java SMSSDK.EVENT_GET_VERIFICATION_CODE属性的具体用法?Java SMSSDK.EVENT_GET_VERIFICATION_CODE怎么用?Java SMSSDK.EVENT_GET_VERIFICATION_CODE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在cn.smssdk.SMSSDK的用法示例。


在下文中一共展示了SMSSDK.EVENT_GET_VERIFICATION_CODE属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseEvent

private static String parseEvent(int event) {
	switch (event) {
	case SMSSDK.EVENT_GET_CONTACTS:
		return "EVENT_GET_CONTACTS";
	case SMSSDK.EVENT_GET_FRIENDS_IN_APP:
		return "EVENT_GET_FRIENDS_IN_APP";
	case SMSSDK.EVENT_GET_NEW_FRIENDS_COUNT:
		return "EVENT_GET_NEW_FRIENDS_COUNT";
	case SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES:
		return "EVENT_GET_SUPPORTED_COUNTRIES";
	case SMSSDK.EVENT_GET_VERIFICATION_CODE:
		return "EVENT_GET_VERIFICATION_CODE";
	case SMSSDK.EVENT_SUBMIT_USER_INFO:
		return "EVENT_SUBMIT_USER_INFO";
	case SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE:
		return "EVENT_SUBMIT_VERIFICATION_CODE";
	default:
		return null;
	}
}
 
开发者ID:isuhao,项目名称:QMark,代码行数:20,代码来源:ShareSdk.java

示例2: afterEvent

@Override
public void afterEvent(int event, int result, Object data) {
    if (result != SMSSDK.RESULT_COMPLETE) {
        Log.v("cc", "连接短信验证码服务器失败");
        ((Throwable) data).printStackTrace();
        return;
    }
    //回调完成
    if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
        //验证码验证成功,服务器的反馈事件
        //实例化短信监听器
        Looper.prepare();
        Toast.makeText(getApplicationContext(), R.string.verify_succ, Toast.LENGTH_SHORT).show();
        Looper.loop();
        Log.v("cc", "验证成功");
        register();
    } else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
        //手机请求验证码,服务器在发送验证码之后,给与的网络反馈
        isSendMsg = true;
        Looper.prepare();
        Toast.makeText(getApplicationContext(), R.string.send_succ, Toast.LENGTH_SHORT).show();
        Log.v("cc", "已经发送验证码");
        Looper.loop();
    }
}
 
开发者ID:Qrilee,项目名称:DevAsimpleApp,代码行数:25,代码来源:LoginActivity.java

示例3: initSms

private void initSms() {

        // 创建EventHandler对象
        eventHandler = new EventHandler() {
            public void afterEvent(int event, int result, Object data) {

                if (result == SMSSDK.RESULT_COMPLETE) {
                    //回调完成
                    if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
                        //提交验证码成功
                    } else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
                        //获取验证码成功
                        afterVerificationCodeRequested((Boolean) data);
                    } else if (event == SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES) {
                        //返回支持发送验证码的国家列表
                    }
                } else if (data instanceof Throwable) {
                    Throwable throwable = (Throwable) data;
                    String msg = throwable.getMessage();
                    ToastUtils.setGravity(Gravity.CENTER, 0, 0);
                    ToastUtils.showShortSafe(msg);
                } else {
                    ((Throwable) data).printStackTrace();
                }
            }
        };

        // 注册监听器
        SMSSDK.registerEventHandler(eventHandler);
    }
 
开发者ID:gaolhjy,项目名称:cniao5,代码行数:30,代码来源:RegActivity.java

示例4: init

/**
 * 初始化资源,准备回调,创建监听器
 */
public static void init(Context con, SMSValidListener smsValidListener) {
    if(!isReady) {
        context = con;
        listener = smsValidListener;
        SMSSDK.initSDK(context, APPKEY, APPSEC);
        handler = new EventHandler(){
            @Override
            public void afterEvent(int event, int result, Object data) {
                if(listener == null)
                    return;

                if(result == SMSSDK.RESULT_COMPLETE) {
                    if(event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE)
                        listener.onVerifySucceeded();
                    if(event == SMSSDK.EVENT_GET_VERIFICATION_CODE)
                        listener.onMsgSent();
                } else {
                    listener.onVerifyFailed();
                    ((Throwable)data).printStackTrace();
                }
            }
        };
        SMSSDK.registerEventHandler(handler);
        isReady = true;
    }
}
 
开发者ID:lfkdsk,项目名称:PracticeCode,代码行数:29,代码来源:SMSValid.java

示例5: onCreate

@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      setContentView(R.layout.activity_login);
      initView();
//SMSSDK.initSDK(this, "142ffc51bc7be", "ca1b80c5a359dc66dbfa0629108048e2");
SMSSDK.initSDK(this, "1488ed0f38d80", "b07247c27cd9fe697c4c56a659b0804a");
eh=new EventHandler(){

	@Override
	public void afterEvent(int event, int result, Object data) {

		if (result == SMSSDK.RESULT_COMPLETE) {
			//回调完成
			if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
				//提交验证码成功
				Log.e("sms","提交验证码成功");
				login();

			}else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE){
				//获取验证码成功
				Log.e("sms","获取验证码成功 ");



			}else if (event ==SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES){
				//返回支持发送验证码的国家列表
				Log.e("sms","获取国家列表成功 "+data.toString());
			}
		}else{
			Log.e("code", "error");
			Toast.makeText(LoginActivity.this, "code error", Toast.LENGTH_SHORT).show();
			((Throwable)data).printStackTrace();
		}
	}
};
SMSSDK.registerEventHandler(eh);
  }
 
开发者ID:liudabao,项目名称:Evisa,代码行数:39,代码来源:LoginActivity.java

示例6: handleMessage

public void handleMessage(Message msg) 
{
	
	if(msg.what == -9)
	{
		requestCodeBtn.setText("重新发送(" + i + ")");
	}
	else if(msg.what == -8)
	{
		requestCodeBtn.setText("获取验证码");
		requestCodeBtn.setClickable(true);
		i = 30;
	}
	else if(msg.what == -10)
	{
		int event = msg.arg1;
		int result = msg.arg2;
		Object data = msg.obj;
		if(result == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE)
		{
			Toast.makeText(getApplicationContext(), "提交验证码成功", Toast.LENGTH_SHORT).show();
			Intent intent = new Intent(LoginActivity.this, MainActivity.class);
			startActivity(intent);
		}
		else if(event == SMSSDK.EVENT_GET_VERIFICATION_CODE)
		{
			Toast.makeText(getApplicationContext(), "验证码已经发送", Toast.LENGTH_SHORT).show();
		}
	}
}
 
开发者ID:ChuPeng1013,项目名称:SMSTesting,代码行数:30,代码来源:LoginActivity.java

示例7: handleMessage

@Override
public void handleMessage(Message msg) {
    super.handleMessage(msg);
    int event = msg.arg1;
    int result = msg.arg2;
    Object data = msg.obj;
    Log.e("event", "event=" + event);
    if (result == SMSSDK.RESULT_COMPLETE) {
        System.out.println("----" + event);
        //短信注册成功后,返回MainActivity,然后提示新好友
        if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {//提交验证码成功
            if (result == SMSSDK.RESULT_COMPLETE) {
                Toast.makeText(getApplicationContext(), "依然走短信验证", Toast.LENGTH_SHORT).show();
            }

        } else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
            Toast.makeText(getApplicationContext(), "验证码已经发送", Toast.LENGTH_SHORT).show();
            textView2.setText("验证码已经发送");
        } else if (event == SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES) {//返回支持发送验证码的国家列表
            Toast.makeText(getApplicationContext(), "获取国家列表成功", Toast.LENGTH_SHORT).show();
            countryTextView.setText(data.toString());
            System.out.println("+++" + getApplicationContext());
        } else if (event == SMSSDK.RESULT_ERROR) {
            Toast.makeText(getApplicationContext(), "------", Toast.LENGTH_SHORT).show();
        }
    } else {
        ((Throwable) data).printStackTrace();
        Toast.makeText(getApplicationContext(), "错误" + data, Toast.LENGTH_SHORT).show();
    }

}
 
开发者ID:CrazyDudo,项目名称:MobSMS,代码行数:31,代码来源:CustomUI.java

示例8: handleMessage

@Override
public void handleMessage(Message msg) {
    final RegActivity activity = activityWeakReference.get();
    int event = msg.arg1;
    int result = msg.arg2;
    Object data = msg.obj;

    if (result == SMSSDK.RESULT_COMPLETE) {
        //正确进行
        if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
            //获取验证码
            activity.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(activity, "验证码已发送",
                            Toast.LENGTH_SHORT).show();
                    activity.startVerCodeCountDown();
                }
            });

        } else if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
            //验证码正确
            activity.checkVerCode = true;
            activity.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    activity.stopUIDialog();
                }
            });
            //执行注册逻辑
            if (activity.checkPassword() && activity.checkVerCode) {

                activity.runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        //打开正在注册对话框
                        activity.startRegUIDialog();
                        String disCode = activity.nonspaceConvert(activity.editDisCode.getText().toString()); //区号
                        String phoneNum = activity.nonspaceConvert(activity.editPhone.getText().toString()); //手机号码
                        String password = activity.editPassword.getText().toString(); //密码

                        //开启网络请求
                        activity.addUserOnServer(disCode, phoneNum, password);
                    }
                });


            }

        }

    } else {
        //出现异常
        int status = 0;
        try{
            ((Throwable) data).printStackTrace();
            Throwable throwable = (Throwable) data;

            JSONObject object = new JSONObject(throwable.getMessage());
            final String des = object.optString("detail");
            status = object.optInt("status");
            if (!TextUtils.isEmpty(des)) {
                activity.runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        activity.stopUIDialog();
                        Toast.makeText(activity, des, Toast.LENGTH_SHORT).show();
                    }
                });
            }

        } catch (Exception e) {
            SMSLog.getInstance().w(e);
        }
    }
}
 
开发者ID:838030195,项目名称:DaiGo,代码行数:76,代码来源:RegActivity.java

示例9: handleMessage

@Override
public void handleMessage(Message msg) {
    final FragmentVerifyPhone fragment = fragmentVerifyPhoneWeakReference.get();
    int event = msg.arg1;
    int result = msg.arg2;
    Object data = msg.obj;

    if (result == SMSSDK.RESULT_COMPLETE) {
        //正确进行
        if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
            //获取验证码
            Message uiMsg = new Message();
            uiMsg.what = 0;
            fragment.getActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(fragment.getContext(), "验证码已发送",
                            Toast.LENGTH_SHORT).show();
                    fragment.startVerCodeCountDown();
                }
            });

        } else if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
            //验证码正确
            fragment.checkVerCode = true;
            fragment.stopVerifyUIDialog();
            fragment.getActivity().runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    fragment.fragmentResetPassword.setFindPhone(fragment.editPhone.getText().toString());
                    fragment.replaceFragment(fragment.fragmentResetPassword, fragment.SLIDE_FROM_RIGHT_TO_LEFT);
                }
            });
        }

    } else {
        //出现异常
        int status = 0;
        fragment.stopVerifyUIDialog();
        try{
            ((Throwable) data).printStackTrace();
            Throwable throwable = (Throwable) data;

            JSONObject object = new JSONObject(throwable.getMessage());
            final String des = object.optString("detail");
            status = object.optInt("status");
            if (!TextUtils.isEmpty(des)) {
                fragment.getActivity().runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        Toast.makeText(fragment.getContext(), des, Toast.LENGTH_SHORT).show();
                    }
                });
            }

        } catch (Exception e) {
            SMSLog.getInstance().w(e);
        }
    }
}
 
开发者ID:838030195,项目名称:DaiGo,代码行数:60,代码来源:FragmentVerifyPhone.java

示例10: handleMessage

@Override
public void handleMessage(Message msg) {
    final ResetPhoneActivity activity = activityWeakReference.get();
    int event = msg.arg1;
    int result = msg.arg2;
    Object data = msg.obj;

    if (result == SMSSDK.RESULT_COMPLETE) {
        //正确进行
        if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
            //获取验证码
            activity.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast.makeText(activity, "验证码已发送",
                            Toast.LENGTH_SHORT).show();
                    activity.startVerCodeCountDown();
                }
            });

        } else if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
            //验证码正确
            activity.checkVerCode = true;
            activity.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    activity.stopUIDialog();
                }
            });
            //执行修改逻辑
            if (activity.checkVerCode) {

                activity.runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        //打开正在执行对话框
                        activity.startRegUIDialog();

                        String phoneNum = activity.nonspaceConvert(activity.ETNewPhone.getText().toString()); //手机号码

                        //开启网络请求
                        activity.updateUserOnServer(phoneNum);
                    }
                });


            }

        }

    } else {
        //出现异常
        int status = 0;
        try{
            ((Throwable) data).printStackTrace();
            Throwable throwable = (Throwable) data;

            JSONObject object = new JSONObject(throwable.getMessage());
            final String des = object.optString("detail");
            status = object.optInt("status");
            if (!TextUtils.isEmpty(des)) {
                activity.runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        activity.stopUIDialog();
                        Toast.makeText(activity, des, Toast.LENGTH_SHORT).show();
                    }
                });
            }

        } catch (Exception e) {
            SMSLog.getInstance().w(e);
        }
    }
}
 
开发者ID:838030195,项目名称:DaiGo,代码行数:75,代码来源:ResetPhoneActivity.java

示例11: initShareSDK

private void initShareSDK() {
    // 暂时支持中国
    SMSSDK.initSDK(getActivity(), Constants.MOB_APP_KEY, Constants.MOB_APP_SECRET);
    EventHandler eh = new EventHandler() {

        @Override
        public void afterEvent(int event, int result, Object data) {

            if (result == SMSSDK.RESULT_COMPLETE) {
                //回调完成
                if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
                    //提交验证码成功
                    Timber.d("validate code success");
                    registerToServer();
                } else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
                    //获取验证码成功
                    Timber.d("get code vericode success");
                    isTimeCount = true;
                    count = 0;
                    handler.postDelayed(timeCount, INTERVAl);
                } else if (event == SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES) {
                    //返回支持发送验证码的国家列表
                }
            } else {
                showTip = Constants.INVALID;
                //回调完成
                if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
                    //提交验证码失败
                    showTip = R.string.code_invalid;
                    isSubmit = false;
                } else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
                    //获取验证码成功
                    Timber.d("get code vericode fail");
                    isTimeCount = false;
                    showTip = R.string.getcode_fail;
                } else if (event == SMSSDK.EVENT_GET_SUPPORTED_COUNTRIES) {
                    //返回支持发送验证码的国家列表
                }
                if (showTip != Constants.INVALID) {
                    if (getActivity() == null || getActivity().isFinishing()) {
                        return;
                    }
                    getActivity().runOnUiThread(() -> ToastHelper.showShortTip(showTip));
                }
            }
        }
    };
    SMSSDK.registerEventHandler(eh); //注册短信回调
}
 
开发者ID:klisly,项目名称:fingerpoetry-android,代码行数:49,代码来源:RegisterFragment.java

示例12: handleMessage

public void handleMessage(Message msg) {
	if (msg.what == -9) {
		bt_getNum.setText("重新发送(" + i + ")");
	} else if (msg.what == -8) {
		bt_getNum.setText("获取验证码");
		bt_getNum.setClickable(true);
		i = 30;
	} else {
		int event = msg.arg1;
		int result = msg.arg2;
		Object data = msg.obj;
		Log.e("event", "event=" + event);
		if (result == SMSSDK.RESULT_COMPLETE) {
			System.out.println("-----------验证码SMSSDK.RESULT_COMPLETE:"+SMSSDK.RESULT_COMPLETE);
			// 短信注册成功后,返回MainActivity,然后提示
			if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {// 提交验证码成功
				Toast.makeText(getApplicationContext(), "提交验证码成功",
						Toast.LENGTH_SHORT).show();
				/*
				 * 把将要发表的评论上传 跳转到上一界面 // * 1.以json的方式上传到数据库 // *
				 * 2.在上一界面解析得到数据
				 */
				dialog_yanZheng.dismiss();
				System.out.println("-------Username:"
						+ AppApplication.getApp().getUsername());
				// Toast.makeText(ItQuan_KeJiChat_ClickImgEdit.this,
				// AppApplication.getApp().getUsername(), 100).show();
				Intent intent = new Intent(
						ItQuan_KeJiChat_ClickImgEdit.this,
						KejiChatActivity.class);
				intent.putExtra("title", edit_title.getText()
						.toString());// 发表标题
				intent.putExtra("content", editext_content.getText()
						.toString());// 发表内容
				intent.putExtra("author", AppApplication.getApp()
						.getUsername());// 作者名字
				SimpleDateFormat date = new SimpleDateFormat("yy-MM-dd");
				intent.putExtra("date", date.format(new Date()) + "");// 获得当前时间
				intent.putExtra("type_quan", "iOS圈");// 默认圈子类型
				System.out.println("Username-----------:"
						+ AppApplication.getApp().getUsername());
				// intent.putExtra("photo_path",imgPath);//得到取得的图片
				// System.out.println("listPhotodata:"+listPhotodata.size());
				// System.out.println("---title"+edit_title.getText()+"======"+editext_content.getText());
				// intent.putExtra("photoes", img_photo);
				setResult(121, intent);
				finish();
			} else if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
				Toast.makeText(getApplicationContext(), "验证码已经发送",
						Toast.LENGTH_SHORT).show();
			} else {
				((Throwable) data).printStackTrace();
			}
		}
	}
}
 
开发者ID:androidWeq,项目名称:ItHome,代码行数:56,代码来源:ItQuan_KeJiChat_ClickImgEdit.java

示例13: handleMessage

@Override
public void handleMessage(Message msg) {


    if (msg.what == 1) {

        tv_getcode.setText("重新发送(" + i + ")");
        if (i == 0) {
            i = 60;
            tv_getcode.setText("获取验证码");
            tv_getcode.setEnabled(true);

        }


    } else if (msg.what == 2) {
        int event = msg.arg1;
        int result = msg.arg2;
        Object data = msg.obj;


        if (result == SMSSDK.RESULT_COMPLETE) {

            if (event == SMSSDK.EVENT_GET_VERIFICATION_CODE) {
                Toast.makeText(getActivity(), "验证码已经发送", Toast.LENGTH_SHORT).show();

            } else if (event == SMSSDK.EVENT_SUBMIT_VERIFICATION_CODE) {
                DialogView.dismiss();
                if(type.equals("regster")){
                    ((PhoneRegsterActivity) getActivity()).gotoPhoneRegsterToMessgae();
                }else if(type.equals("password")){
                    ((PhoneRegsterActivity) getActivity()).gotoGetPassword();
                }
                // Toast.makeText(getActivity(), "验证成功", Toast.LENGTH_SHORT).show();

            }


        } else if (result == SMSSDK.RESULT_ERROR) {
            DialogView.dismiss();
            Toast.makeText(getActivity(), "验证失败,请重试", Toast.LENGTH_SHORT).show();
        }
    }


}
 
开发者ID:jiangzehui,项目名称:xmpp,代码行数:46,代码来源:PhoneRegsterFragment.java


注:本文中的cn.smssdk.SMSSDK.EVENT_GET_VERIFICATION_CODE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。