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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:58:50+00:00 2026-05-28T13:58:50+00:00

My application creates a text file. I want that users to have easy access

  • 0

My application creates a text file. I want that users to have easy access to these files. I write this text file them on the sdcard. I want to allow users to edit the file with other programs.
I see these files using the File Explorer, but I can not see using file manager.

String extPath = Environment.getExternalStorageDirectory().getAbsolutePath();
        try{
    String pathPrefix = extPath + "/Android/data/" +      getApplication().getPackageName() + "/cache/";
    //File extPathFile = getExternalFilesDir(pathPrefix+FileName);
    Log.d("TAG", "pathPrefix="+pathPrefix);
    Log.d("TAG", "FileName="+FileName);
    File file = new File(pathPrefix, FileName+".txt");
    if(file.exists()){
    Log.d("TAG", "File("+pathPrefix+FileName+")exist"); 
    };
   OutputStreamWriter outStream = 
            new OutputStreamWriter(new FileOutputStream(file));

Logcat:

01-22 14:26:15.834: D/TAG(14290): pathPrefix=/mnt/sdcard/Android/data/mast.avalons/cache/
01-22 14:26:15.834: D/TAG(14290): FileName=S000004_21-10-2011
01-22 14:26:16.044: D/TAG(14290): java.io.FileNotFoundException: /mnt/sdcard/Android/data/mast.avalons/cache/S000004_21-10-2011.txt (No such file or directory)

Thanks!

  • 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-28T13:58:51+00:00Added an answer on May 28, 2026 at 1:58 pm

    I think you should create intermediate directories :

    new File(pathPrefix).mkdirs();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create .bat application that read into text file, find / and
I have created a .net application that is currently using a encrypted text file
I have an application that creates, and destroys thousands of objects. Is it worth
I have an information retrieval application that creates bit arrays on the order of
I'm trying to write a Delphi console application that creates a TStream for its
I have a unique issue - I am designing a web application that creates
I have created an application using Netbeans 6.9. In the application I want that
I have this application that shows an item in the system's status bar, and
I want to create a calendar in my application that external users can view.
I have created MVC application. I want to include js or css file into

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.