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

  • Home
  • SEARCH
  • 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 8216081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:00:34+00:00 2026-06-07T12:00:34+00:00

The problem is that I put the file through the DDMS Perspective in data

  • 0

The problem is that I put the file through the DDMS Perspective in data and /data/data folder and when I try to access to that files, the FileNotFoundException occures.
Code:

                String path = Environment.getExternalStorageState()+"/analyzer_settings.xml";
                System.out.println(path);

                try {
                    Scanner in = new Scanner(new File(path));
                    while (in.hasNext()) {
                        System.out.println(in.nextLine());
                    }
                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

Exception with print:

07-11 17:10:02.470: I/System.out(13506): mounted/analyzer_settings.xml
07-11 17:10:02.500: W/System.err(13506): java.io.FileNotFoundException: /mounted/analyzer_settings.xml: open failed: ENOENT (No such file or directory)

I’ve tried also:

String path = Environment.getExternalStorageState()+"/data/analyzer_settings.xml";
or 
String path = Environment.getExternalStorageState()+"/data/data/analyzer_settings.xml";

nothing worked for me.

  • 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-07T12:00:36+00:00Added an answer on June 7, 2026 at 12:00 pm

    use

    String path = Environment.getExternalStorageDirectory().getAbsolutePath()
                  +"analyzer_settings.xml";
    

    instead of

     String path = Environment.getExternalStorageState()+"/analyzer_settings.xml";
    

    EDIT:
    Because as doc says:

    getExternalStorageDirectory ():

    Gets the Android external storage directory. This directory may not
    currently be accessible if it has been mounted by the user on their
    computer, has been removed from the device, or some other problem has
    happened. You can determine its current state with
    getExternalStorageState().

    and

    getExternalStorageState():

    Gets the current state of the primary “external” storage device.

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

Sidebar

Related Questions

Im currently facing the problem that when i try to set focus on some
I have a jar that when run, goes through the files in a directory
I want to sent some information through a from, executing a php file that
The problem that I am having is that my values aren't coming through with
I have problem with passing variables through views. But, first some code // i
I have a Java problem that involves reading a text file and check that
Simple problem that I can't figure out... How can I print a '%' character
The problem that I have is somehow very specific. I have to implement a
I have a problem that I'm working on for quite some time now. I
Here is a problem that has been bothering me a lot about Python, I

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.