Ejemplo n.º 1
0
 private void doCheckNetTask() {
   User user = SPUtil.getDefaultUser(this, null);
   Map<String, Object> taskParams = new HashMap<String, Object>();
   taskParams.put(Task.FAN_ACTIVITY, HomePageActivity.class.getSimpleName());
   taskParams.put(User.PHONENUMBER, user.getPhoneNumber());
   taskParams.put(User.PASSWORD, user.getPassword());
   taskParams.put(Task.FAN_AUTHO_DEVICE_CODE, JPushInterface.getRegistrationID(this));
   taskParams.put(Task.FAN_AUTHO_SYSTEM_TYPE, Task.FAN_AUTHO_SYSTEM_TYPE_ANDROID);
   if (first_time_login) {
     taskParams.put(Task.FAN_AUTHO_BACK_LOGIN, Task.FAN_AUTHO_BACK_LOGIN_NO);
   } else {
     taskParams.put(Task.FAN_AUTHO_BACK_LOGIN, Task.FAN_AUTHO_BACK_LOGIN_YES);
   }
   Task task = new Task(Task.FAN_AUTHO, taskParams);
   IfanService.addTask(task);
 }
Ejemplo n.º 2
0
  private void doCheckEMNetTask() {
    String userId = SPUtil.getDefaultUser(this, null).getId();
    EMChatManager.getInstance()
        .login(
            userId,
            User.EM_PASSWORD,
            new EMCallBack() {
              public void onSuccess() {}

              public void onProgress(int arg0, String arg1) {}

              public void onError(int arg0, String arg1) {
                runOnUiThread(
                    new Runnable() {
                      public void run() {
                        ToastUtil.prompt(HomePageActivity.this, "登录聊天服务器失败");
                      }
                    });
              }
            });
  }