title: How to convert a string image path to Base64 string in android?
body: <p>so im working with uploading string paths into imageViews, and it works fine, but my IOS app cannot use my string paths, so i need to switch over to base 64 strings. How do I convert my string path into a base 64 image and upload that into an imageview without it having out of memory error?</p>
  
  <p>Below is what I currently have on myActivityResult().</p>
  
  <pre><code>@Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          addImageImageView.setVisibility(View.GONE);
          if (requestCode == Constants.REQUEST_CODE &amp;&amp; resultCode == RESULT_OK &amp;&amp; data != null) {
              //First we gotta make sure to add the images to
              ArrayList&lt;Image&gt; imagesFromGallery = data.getParcelableArrayListExtra(Constants.INTENT_EXTRA_IMAGES);//Image is a personal object I made.
  
              for (int i = 0; i &lt; imagesFromGallery.size(); i++) {
                  images.add(imagesFromGallery.get(i).path);
                  LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
                  lp.setMargins(20, 20, 0, 0);//5dp = 20 pixels
                  lp.height = 720;//180dp = 720pixels
                  lp.width = 1400;//330dp = 1320 pixels.
                  ImageView newImageView = new ImageView(this);
                  newImageView.setLayoutParams(lp);
                  Glide.with(this).load(imagesFromGallery.get(i)).centerCrop().into(newImageView);
                  imageLinearLayout.addView(newImageView, 0);
              }
      }
  </code></pre>