title: How to send Image from Imageview to a Server
body: <p>I am making SignUp form which includes many fields along with Profile Picture. I have converted everything to a string except the Image. I am unable to understand that How can I send Image to server along with other string values when someone clicks on the SignUp button. </p>
  
  <p>Following is my source code for your perusal:</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.EditText;
  import android.widget.ImageView;
  import android.widget.Toast;
  
  
  public class SignUp extends Activity {
      ImageView imageView;
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.signup);
  
  
          imageView = (ImageView) findViewById(R.id.imagecontact);
      }
      public void onGalleryClick(View view){
          Intent intent = new Intent();
          intent.setType("image/*");
          intent.setAction(Intent.ACTION_GET_CONTENT);
          startActivityForResult(Intent.createChooser(intent,ACCESSIBILITY_SERVICE),1);
      }
      @Override
      public void onActivityResult(int requestCode,int resultCode,Intent data){
          if(resultCode == RESULT_OK){
              if(requestCode == 1)
                  imageView.setImageURI(data.getData());
          }
      }
  
  
      public void onSignUpClick(View view) {
          if (view.getId() == R.id.BT_signup) {
              EditText name = (EditText) findViewById(R.id.ED_bakeryname);
              EditText maail = (EditText) findViewById(R.id.ED_emailaddress);
              EditText number = (EditText) findViewById(R.id.ED_mobilenumber);
              EditText address = (EditText) findViewById(R.id.ED_postaladd);
              EditText pass1 = (EditText) findViewById(R.id.ED_pass1);
              EditText pass2 = (EditText) findViewById(R.id.ED_pass2);
              ImageView imageView1 =(ImageView)view.findViewById(R.id.imagecontact);
  
  
              String namestring = name.getText().toString();
              String mailstring = name.getText().toString();
              String numberstring = name.getText().toString();
              String addressstring = name.getText().toString();
              String pass1string = name.getText().toString();
              String pass2string = name.getText().toString();
  
  
              if (!pass1string.equals(pass2string)) {
                  //popup msg
  
                  Toast pword = Toast.makeText(SignUp.this, "Passwords don't match!", Toast.LENGTH_SHORT);
                  pword.show();
              }
          }
  
      }
  
  
  }
  </code></pre>