title: How to send data of radio buttons/radio group using volley when checked
body: <p>I am doing a register form for an app I'm creating. It includes first name, last name, email, phone number, password, birth day and gender. The gender in a radio group, obviously using radio buttons. I am using Volley for networking data. How do I pass the checked radio button value using volley?</p>
  
  <p>Here is my java code <strong>so far</strong>:</p>
  
  <pre><code>public class B_Register extends AppCompatActivity implements View.OnClickListener {
  
  public static final String REGISTER_URL = "http://10.0.0.245/register_alex's_app.php";
  
  public static final String FNAME_REGISTER = "first_name";
  public static final String LNAME_REGISTER = "last_name";
  public static final String EMAIL_REGISTER = "email_register";
  public static final String USERNAME_REGISTER = "username_register";
  public static final String PHONE_NUMBER_REGISTER = "phone_register";
  public static final String PASSWORD_REGISTER = "password_register";
  public static final String BDAY_REGISTER = "bday_register";
  
  
  private EditText fname;
  private EditText lname;
  private EditText email;
  private EditText phone_number;
  private EditText new_username;
  private EditText new_password;
  private EditText bday;
  
  private RadioGroup gender;
  
  private Button register_btn;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.b_register);
  
      fname = (EditText)findViewById(R.id.first_name_et);
      lname = (EditText)findViewById(R.id.last_name_et);
      email = (EditText)findViewById(R.id.email_et);
      phone_number = (EditText)findViewById(R.id.phone_et);
      new_username = (EditText)findViewById(R.id.username_et);
      new_password = (EditText)findViewById(R.id.password_et);
      bday = (EditText)findViewById(R.id.bday_et);
  
      gender = (RadioGroup)findViewById(R.id.gender_register);
  
      register_btn = (Button)findViewById(R.id.register_btn);
      register_btn.setOnClickListener(this);
  
  }
  
  public void onTermsOfUseClick(View view) {
  }
  
  @Override
  public void onClick(View view) {
  
      final String firstName = fname.getText().toString().trim();
      final String lastName = lname.getText().toString().trim();
      final String new_email = email.getText().toString().trim();
      final String newPhoneNumber = phone_number.getText().toString().trim();
      final String userName = new_username.getText().toString().trim();
      final String newPassword = new_password.getText().toString().trim();
      final String bDay = bday.getText().toString().trim();
  
      if(TextUtils.isEmpty(firstName)) {
          fname.setError("Please enter your first name.");
          return;
      }else if(TextUtils.isEmpty(lastName)) {
          lname.setError("Please enter your last name.");
          return;
      }else if(TextUtils.isEmpty(new_email)) {
          email.setError("Please enter your email.");
          return;
      }else if(TextUtils.isEmpty(newPhoneNumber)) {
          phone_number.setError("Please enter your phone number.");
          return;
      }else if(TextUtils.isEmpty(userName)) {
          new_username.setError("Please enter a valid username, 5-25 characters.");
          return;
      }else if (TextUtils.isEmpty(newPassword)) {
          new_password.setError("Please enter valid password, 5-15 characters.");
      }else if (TextUtils.isEmpty(bDay)) {
          bday.setError("Please enter your birth day.");
      }
  }
  }
  </code></pre>