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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:15:15+00:00 2026-05-27T14:15:15+00:00

If I run the following code on an ASUS Transformer then ‘testfile.txt’ is created

  • 0

If I run the following code on an ASUS Transformer then ‘testfile.txt’ is created in the top level of the ‘sd card’ directory as expected.

private void testWriteFile () throws IOException
{
    File sdCard = Environment.getExternalStorageDirectory();
    File file = new File(sdCard, "testfile.txt");

    FileOutputStream myOutput = new FileOutputStream(file);
    byte buffer[] = {'0','1','2','3','4','5','6','7','8','9'};      

    myOutput.write(buffer,0,buffer.length);

    myOutput.flush();
    myOutput.close();
}

I can view the file on the ASUS Transformer using a File Manager app. I can see the file from a Windows dos box via the ‘adb shell’ command and its permissions appear to be set correctly. However, if I view the directory from Windows Explorer, ‘testfile.txt’ is not there. I have set the options to display hidden and system files, but with no luck.

If I use the ASUS file manager app to change the name of ‘testfile.txt’, then it becomes visible in Windows Explorer, so other apps are able to make files visible in Explorer.

If I run the same code on a ZTE Blade (Orange San Francisco) then I can see ‘testfile.txt’ in Windows Explorer without needing to change its name.

Is there something else I need to do to finalize this file so that it becomes visible?

A similar problem is reported here, Can't see a file in Windows written by an android app on sd-card unless I "Force Close" the app, but forcing a close in my case does not make the file visible.

  • 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-27T14:15:16+00:00Added an answer on May 27, 2026 at 2:15 pm

    I have solved this with the following instruction:

        MediaScannerConnection.scanFile
                 (this, new String[] {file.toString()}, null, null);
    

    I am not sure why this is required for the Asus and not for the ZTE Blade. However, there is a difference in the way that they connect to my PC and I suspect this is the reason.

    The ZTE Blade appears as a USB mass storage device and is assigned a drive letter. The Asus appears as a portable media player (MTP) and is not assigned a drive letter.

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

Sidebar

Related Questions

When I run the following code to test copying a directory, I get a
when I trying to run following code. var result = from c in db.brand
I run the following code from command line: public class MemoryTest { public static
I run the following code on a Windows platform. The purpose is the know
When I run the following Code it crashes at the last line. I don't
When I run the following code I get B as expected: class A {
If I run the following code on my HTC magic phone I get a
When I run the following code: private void button1_Click(object sender, EventArgs e) { Bitmap
When I run the following code, I get the exception below: ''# NOTE: ExcelApp
When I run the following code, it only seems to be downloading the first

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.