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?
Below is what I currently have on myActivityResult().
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
addImageImageView.setVisibility(View.GONE);
if (requestCode == Constants.REQUEST_CODE && resultCode == RESULT_OK && data != null) {
//First we gotta make sure to add the images to
ArrayList<Image> imagesFromGallery = data.getParcelableArrayListExtra(Constants.INTENT_EXTRA_IMAGES);//Image is a personal object I made.
for (int i = 0; i < 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);
}
}