コード例 #1
0
  private boolean requestLogin(String keys) {
    if (!CommonUtil.isNetworkConnect(this)) {
      CommonUtil.showToast(R.string.toast_connet_fail, this);
      return false;
    }
    PublicType.UserLogin object = PublicTypeBuilder.buildUserLogin(this, keys);

    BaseRequestPacket packet = new BaseRequestPacket();
    packet.context = this;
    packet.action = PublicType.USER_LOGIN_MASID;
    packet.object = object;

    mClientEngine.httpGetRequestEx(packet, this);

    return true;
  }
コード例 #2
0
  private boolean requestRegister() {
    if (!CommonUtil.isNetworkConnect(this)) {
      CommonUtil.showToast(R.string.toast_connet_fail, this);
      return false;
    }

    String keys = LocalConfigSharePreference.getKeys(this);
    if (keys.equals("")) {
      PublicType.UserRegister object = PublicTypeBuilder.buildUserRegister(this);

      BaseRequestPacket packet = new BaseRequestPacket();
      packet.context = this;
      packet.action = PublicType.USER_REGISTER_MASID;
      packet.object = object;

      mClientEngine.httpGetRequestEx(packet, this);
    } else {
      return requestLogin(keys);
    }

    return true;
  }