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 4559582
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:48:33+00:00 2026-05-21T17:48:33+00:00

I am working now on application that start the camera and take a photo,

  • 0

I am working now on application that start the camera and take a photo, I didn’t use camera activity, but I wrote my camera app and I want to save the taken image in the internal phone storage in folder called “temPic”

The following code generate the folder and the image, but when I checked the tempPic I found an image called image1.jpg and it’s size is 461115 ( I tried to store the image in SDcard directory and it is the same size), but when I double clicked it a black image appeared, not the taken one although in SDcard I opened it !!!

FileManipulator fileFormat = new FileManipulator(
                getApplicationContext());
        String path = fileFormat.createFolder_PStrg("tempPic") + "/image1.jpg";     
        File file = new File(path);
        Uri outputFileUri = Uri.fromFile(file);

        OutputStream imageFileOS;
        try {


            imageFileOS = getContentResolver().openOutputStream(outputFileUri);
            imageFileOS.write(arg0);
            imageFileOS.flush();
            imageFileOS.close();
            Toast.makeText(AndroidCamera.this, 
                    file.length()+"", 
                    Toast.LENGTH_LONG).show();
            Toast.makeText(AndroidCamera.this, 
                    "Image saved: " + outputFileUri.toString(), 
                    Toast.LENGTH_LONG).show();

        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        camera.startPreview();
  • 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-05-21T17:48:34+00:00Added an answer on May 21, 2026 at 5:48 pm

    I don’t know if this can help you but this is how I save a file to the SD card and it works.

            public void saveToSD(Bitmap outputImage){
    
    
                File storagePath = new File(Environment.getExternalStorageDirectory() + "/MyPhotos/"); 
                storagePath.mkdirs(); 
    
                File myImage = new File(storagePath, Long.toString(System.currentTimeMillis()) + ".jpg");
    
                try { 
                    FileOutputStream out = new FileOutputStream(myImage); 
                    outputImage.compress(Bitmap.CompressFormat.JPEG, 80, out); 
                    out.flush();    
                    out.close();
                } catch (Exception e) { 
                    e.printStackTrace(); 
                }               
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Yesterday the application was working normally, and i didn't edit my codes. But now
Here i make 5 Tab buttons that are working proper but now i want
i am working on a web application that now requires a CMS. Could you
Right now I'm working on a web application that receives a significant amount of
Now that I have a read-only application working, I am working on the insert
I'm working on a project that requires a Web-based workflow application. We're now evaluating
I'm working on an application that stores conferences with their start and end date.
In the application that I'm working on right now, I need to periodically check
I am not a web application pro but need to start working on a
I'm working on an application that consist of a couple of activities: Activity 1:

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.