title: How to check whether Email is valid format or not in android
body: <p>How can I validate my fields (eg: <strong>name, email, mobile</strong>). </p>
  
  <p>I validated whether the fields are empty but I don't know how to check whether the format is valid or not</p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>public void btnClick(View v)
  {
      EditText name = (EditText) findViewById(R.id.signup_name);
      EditText email= (EditText) findViewById(R.id.signup_email);
      EditText phone= (EditText) findViewById(R.id.signup_phone);
      if(name.getText().length()==0)
      {
          name.setError("Field cannot be left blank.");
      }
      else if (email.getText().length()==0){
          email.setError("Field cannot be left blank.");
      }
      else if (phone.getText().length()==0){
          phone.setError("Field cannot be left blank.");
      }
  
  }
  </code></pre>