Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8146813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:07:54+00:00 2026-06-06T14:07:54+00:00

I have an application that allows the user to take a picture with the

  • 0

I have an application that allows the user to take a picture with the native camera of the phone, I don’t want to implement all the functionality of a camera (I don’t want to loose the autofocus, flash or some other properties that the native camera might have) so I make this call:

File folder = new File(Environment.getExternalStorageDirectory(),"folder");
    folder.mkdirs();
    File nomedia = new File(folder,".nomedia");
    try{
        nomedia.createNewFile();
    }catch (IOException e){
        e.printStackTrace();
        Log.e("error", e.getMessage());
    }

    File file = new File(folder,"image.jpeg");
    try {
        file.createNewFile();
    } catch (IOException e) {
        e.printStackTrace();
    }
    imageUri = Uri.fromFile(file);
    if(imageUri != null){   
        Log.i(TAG, "imageUri: " + imageUri.getPath());
        imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
     }

Then in a button I have the execution of the intent:

startActivityForResult(imageIntent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);

This works perfectly, it opens the camera, I receive the callback when I take the picture and if I look to the folder with the file explorer of the phone I can see the picture and also the “.nomedia” file that I created.

The thing is that I don’t want the camera to store this image in the gallery of the phone, because, somehow this is “magically” 😉 added to the Gallery of Android and I thought with adding the “.nomedia” file and creating the picture in a separate folder the Gallery won’t scan it. The idea is that the pictures are only for internal use of the app.

Is there anyway of avoiding this? I really searched and try many different ways, but I cannot solve it.

I hope I was clear with the explanation.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T14:07:56+00:00Added an answer on June 6, 2026 at 2:07 pm

    I found this solution:
    Stop saving photos using Android native camera

    The idea is to check which files are in the gallery just before taking the picture and just after it, delete that one that is new.

    It’s not the cleanest solution but it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an android application which allows the user to take a picture using
I have an application that allows the user to download a csv. This works
I have an application that allows the user to edit multiple text fields and
I have a web application that allows a user to view family members. When
I'm using: Hibernate MySQL jBoss I have to create an application that allows user
I have a simple Desktop Facebook application that allows the user to retrieve some
I have written an application that allows a user to define a query, run
I have written an application (using Delphi 2009) that allows a user to select
I'm creating an application (Windows Form) that allows the user to take a screenshot
My application allows it's user to start a camera intent to take pictures to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.