title: How to add the CheckBox value to the database?
body: <p>Inside my android app, I'm trying to add client profiles to my firebase database by filling out fields and checking a few checkboxes and then clicking the Save button. I've successfully added the user's input to the text fields to the database but it doesn't add CheckBox value (whether it's checked or not). 
  I'm guessing this is because the way I'e defined them as String and tried to 'getText'. I'm fairly new and I'm not sure how I would do it otherwise. I was thinking through some kind of IF statement but I'm not 100%. </p>
  
  <p>Any help would be greatly appreciated, thanks guys.</p>
  
  <p>My code seems long but it's just lots of declarations aha!</p>
  
  <p><strong>AddAProfile.java code:</strong></p>
  
  <pre><code>import android.os.Bundle;
  import android.support.design.widget.FloatingActionButton;
  import android.support.design.widget.Snackbar;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.Toolbar;
  import android.text.TextUtils;
  import android.view.View;
  import android.widget.Button;
  import android.widget.CheckBox;
  import android.widget.EditText;
  import android.widget.ImageButton;
  import android.widget.Toast;
  
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  
  import org.w3c.dom.Text;
  
  public class AddProfileActivity extends AppCompatActivity {
  
      EditText etName;
      EditText etCareer;
      CheckBox cbTech;
      CheckBox cbMedi;
      CheckBox nfRenewableEnergy;
      CheckBox nfGoogle;
      CheckBox cfNovartis;
      CheckBox nfTesla;
      CheckBox lrsFB;
      CheckBox lrsAAPL;
      CheckBox lrsYHOO;
      CheckBox cbEURUSD;
      CheckBox lrcuUSDRUB;
      CheckBox lrcoSILVER;
      CheckBox lrcoGOLD;
      CheckBox lrcuGBPUSD;
      CheckBox lriNSDQ;
      CheckBox lriSP500;
      Button bSave;
  
      DatabaseReference databaseClients;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_add_profile);
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
  
          databaseClients = FirebaseDatabase.getInstance().getReference("clients");
  
           etName = (EditText) findViewById(R.id.etName);
           etCareer = (EditText) findViewById(R.id.etCareer);
           cbTech = (CheckBox) findViewById(R.id.cbTech);
           cbMedi = (CheckBox) findViewById(R.id.cbMedi);
           nfRenewableEnergy = (CheckBox) findViewById(R.id.nfRenewableEnergy);
          nfGoogle = (CheckBox) findViewById(R.id.nfGoogle);
          cfNovartis = (CheckBox) findViewById(R.id.cfNovartis);
          nfTesla = (CheckBox) findViewById(R.id.nfTesla);
          lrsFB = (CheckBox) findViewById(R.id.lrsFB);
          lrsAAPL = (CheckBox) findViewById(R.id.lrsAAPL);
          lrsYHOO = (CheckBox) findViewById(R.id.lrsYHOO);
          cbEURUSD = (CheckBox) findViewById(R.id.cbEURUSD);
          lrcuUSDRUB = (CheckBox) findViewById(R.id.lrcuUSDRUB);
          lrcoSILVER = (CheckBox) findViewById(R.id.lrcoSILVER);
          lrcoGOLD = (CheckBox) findViewById(R.id.lrcoGOLD);
          lrcuGBPUSD = (CheckBox) findViewById(R.id.lrcuGBPUSD);
          lriNSDQ = (CheckBox) findViewById(R.id.lriNSDQ);
          lriSP500 = (CheckBox) findViewById(R.id.lriSP500);
          bSave = (Button) findViewById(R.id.bSave);
  
          bSave.setOnClickListener(new View.OnClickListener(){
              @Override
              public void onClick(View view){
                  bSave();
  
              }
          });
  
  
  
      }
  
      private void bSave(){
          String name = etName.getText().toString().trim();
          String career = etCareer.getText().toString().trim();
          String techCB = cbTech.getText().toString();
          String mediCB = cbMedi.getText().toString();
          String renewableEnergyNF = nfRenewableEnergy.getText().toString();
          String googleNF = nfGoogle.getText().toString();
          String novartisNF = cfNovartis.getText().toString();
          String teslaNF = nfTesla.getText().toString();
          String fbLRS = lrsFB.getText().toString();
          String applLRS = lrsAAPL.getText().toString();
          String yhooLRS = lrsYHOO.getText().toString();
          String eurusdCB = cbEURUSD.getText().toString();
          String usdrubCU = lrcuUSDRUB.getText().toString();
          String silverCO = lrcoSILVER.getText().toString();
          String goldCO = lrcoGOLD.getText().toString();
          String gbpusdCU = lrcuGBPUSD.getText().toString();
          String nsdqI = lriNSDQ.getText().toString();
          String sp500I = lriSP500.getText().toString();
  
  
          if(!TextUtils.isEmpty(name)){
            String id =  databaseClients.push().getKey();
  
              Clients clients = new Clients(id, name, career, techCB, mediCB, renewableEnergyNF, googleNF,
                      novartisNF, teslaNF, fbLRS, applLRS, yhooLRS, eurusdCB, usdrubCU, silverCO,
                      goldCO, gbpusdCU, nsdqI, sp500I );
  
              databaseClients.child(id).setValue(clients);
  
              Toast.makeText(this, "Client added", Toast.LENGTH_LONG).show();
  
          }else{
              Toast.makeText(this, "Please enter your name", Toast.LENGTH_LONG).show();
  
          }
  
  
      }
  
  }
  </code></pre>
  
  <p><strong>Clients.java:</strong></p>
  
  <pre><code>/**
   * Created by Joe on 13/04/2017.
   */
  
  public class Clients {
  
      String clientName;
      String clientCareer;
      String techCB;
      String mediCB;
      String renewableEnergyNF;
      String googleNF;
      String novartisNF;
      String teslaNF;
      String fbLRS;
      String applLRS;
      String yhooLRS;
      String eurusdCB;
      String usdrubCU;
      String silverCO;
      String goldCO;
      String gbpusdCU;
      String nsdqI;
      String sp500I;
  
  
      public Clients(String id, String name, String career, String techCB, String mediCB, String renewableEnergyNF, String googleNF, String novartisNF, String teslaNF, String fbLRS, String applLRS, String yhooLRS, String eurusdCB, String usdrubCU, String silverCO, String goldCO, String gbpusdCU, String nsdqI, String sp500I){
  
      }
  
      public Clients(String clientCareer, String clientName, String techCB,String mediCB, String renewableEnergyNF,
                     String googleNF, String novartisNF, String teslaNF,String fbLRS, String applLRS, String yhooLRS, String eurusdCB,
                     String usdrubCU, String silverCO, String goldCO, String gbpusdCU, String nsdqI, String sp500I ) {
  
          this.clientName = clientName;
          this.clientCareer = clientCareer;
          this.techCB = techCB;
          this.mediCB = mediCB;
          this.renewableEnergyNF = renewableEnergyNF;
          this.googleNF = googleNF;
          this.novartisNF = novartisNF;
          this.teslaNF = teslaNF;
          this.fbLRS = fbLRS;
          this.applLRS = applLRS;
          this.yhooLRS = yhooLRS;
          this.eurusdCB = eurusdCB;
          this.usdrubCU = usdrubCU;
          this.silverCO = silverCO;
          this.goldCO = goldCO;
          this.gbpusdCU = gbpusdCU;
          this.nsdqI = nsdqI;
          this.sp500I = sp500I;
      }
  
      public String getClientName() {
          return clientName;
      }
  
      public String getClientCareer() {
          return clientCareer;
      }
  
      public String getTechCB() {
          return techCB;
      }
  
      public String getMediCB() {
          return mediCB;
      }
  
      public String getRenewableEnergyNF() {
          return renewableEnergyNF;
      }
  
      public String getGoogleNF() {
          return googleNF;
      }
  
      public String getNovartisNF() {
          return novartisNF;
      }
  
      public String getTeslaNF() {
          return teslaNF;
      }
  
      public String getFbLRS() {
          return fbLRS;
      }
  
      public String getApplLRS() {
          return applLRS;
      }
  
      public String getYhooLRS() {
          return yhooLRS;
      }
  
      public String getEurusdCB() {
          return eurusdCB;
      }
  
      public String getUsdrubCU() {
          return usdrubCU;
      }
  
      public String getSilverCO() {
          return silverCO;
      }
  
      public String getGoldCO() {
          return goldCO;
      }
  
      public String getGbpusdCU() {
          return gbpusdCU;
      }
  
      public String getNsdqI() {
          return nsdqI;
      }
  
      public String getSp500I() {
          return sp500I;
      }
  }
  </code></pre>