title: How to send Media files like whatsapp in android
body: <p>Am developing an app that enables one to send images,audio and video through the internet. the  person receiving this media files must have installed my app in his device.</p>
  
  <p>What i can do right now is compress the image to be sent. i don't know where to start since most of the online tutorials are using intents to do this but i don't want to trigger another app to carry out the sending. my app should be able to do all this by itself.</p>
  
  <p>this is how am compressing the image</p>
  
  <pre><code>public class ImageCompression extends AsyncTask&lt;String, Void, String&gt; {
  
  private Context context;
  private static final float maxHeight = 1280.0f;
  private static final float maxWidth = 1280.0f;
  
  
  public ImageCompression(Context context){
      this.context=context;
  }
  
  @Override
  protected String doInBackground(String... strings) {
      if(strings.length == 0 || strings[0] == null)
          return null;
  
      return compressImage(strings[0]);
  }
  
  protected void onPostExecute(String imagePath){
      // imagePath is path of new compressed image.
  }
  </code></pre>