• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Get images from folder on android device to display in application

I need a way to read images back into an android app I am developing. The images get saved to a custom folder called Venns Road Accident. I have looked at multiple sources however nothing seems to work for me.

This is the code to capture and save the images.

Code:
public void Pictures (View v)
{
   //Call the camera and get phone date and time
   Intent imageIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
   String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());

   //Create the folder for the images to be saved
   File imagesFolder = new File(Environment.getExternalStorageDirectory(), "Venns Road Accident");
   imagesFolder.mkdirs();

   //Apply the system date and time as the name of the image
   File image = new File(imagesFolder, "VCA_" + timeStamp + ".png");
   Uri uriSavedImage = Uri.fromFile(image);

   //Saving of image and allowing for new image to be captured
   imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage);
   startActivityForResult(imageIntent, CAMERA_REQUEST);
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
   super.onActivityResult(requestCode, resultCode, data);

   if (requestCode == CAMERA_REQUEST)
       Toast.makeText(Pictures.this, "Image Saved", Toast.LENGTH_LONG).show();
   else
       Toast.makeText(Pictures.this, "Image not Saved", Toast.LENGTH_LONG).show();
}
 
  • Like
Reactions: sweetndreemy73

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones