title: How to downsize images before upload to Firebase?
body: <p>How to downsize images before uploading to Firebase? or after</p>
  
  <p>This is my first app
  <a href="https://play.google.com/store/apps/details?id=com.devkang.mystep" rel="nofollow noreferrer">https://play.google.com/store/apps/details?id=com.devkang.mystep</a></p>
  
  <p>I think it takes too long to upload and download.</p>
  
  <pre><code>private void sendPost() {
      mProgressDialog.setMessage("Sending post...");
      mProgressDialog.setCancelable(false);
      mProgressDialog.setIndeterminate(true);
      mProgressDialog.show();
  
      FirebaseUtils.getUserRef(FirebaseUtils.getCurrentUser().getEmail().replace(".", ","))
              .addListenerForSingleValueEvent(new ValueEventListener() {
                  @Override
                  public void onDataChange(DataSnapshot dataSnapshot) {
                      User user = dataSnapshot.getValue(User.class);
                      final String postId = FirebaseUtils.getUid();
                      TextView postDialogTextView = (TextView) mRootView.findViewById(R.id.post_dialog_edittext);
                      String text = postDialogTextView.getText().toString();
  
                    //add hashTag
                      EditText tag = (EditText) mRootView.findViewById(R.id.post_dialog_hash_tag);
                      String hashTag = tag.getText().toString();
  
                      mPost.setUser(user);
                      mPost.setNumComments(0);
                      mPost.setNumLikes(0);
                      mPost.setTimeCreated(System.currentTimeMillis());
                      mPost.setPostId(postId);
                      mPost.setPostText(text);
                      mPost.setPostHashTag(hashTag);
  
                      if (mSelectedUri != null) {
                          FirebaseUtils.getImageSRef()
                                  .child(mSelectedUri.getLastPathSegment())
                                  .putFile(mSelectedUri)
                                  .addOnSuccessListener(getActivity(),
                                          new OnSuccessListener&lt;UploadTask.TaskSnapshot&gt;() {
                                              @Override
                                              public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                                                  String url = Constants.POST_IMAGES + "/" + mSelectedUri.getLastPathSegment();
                                                  mPost.setPostImageUrl(url);
                                                  addToMyPostList(postId);
                                              }
                                          });
                      } else {
                          addToMyPostList(postId);
                      }
                  }
  
                  @Override
                  public void onCancelled(DatabaseError databaseError) {
                      mProgressDialog.dismiss();
                  }
              });
  }
  </code></pre>