Unable to see file in Windows Explorer while it is visible in Android file browser
Asked Answered
A

4

15

Through my Android program I wrote a file like this:

String file = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Files/hello.txt";
BufferedWriter writer = new BufferedWriter(new FileWriter(file));
writer.write(str+"\n");     \\yeah string has a value there
writer.close();

Now when I go to Android's "Astro" File browser, I can see the file hello.txt in /mnt/sdcard/Files but when I mount the sdcard in Windows, I can only see 4 other files which were there in that folder but not hello.txt.

In Windows itself, I even tried to uncheck the hide hidden files option just to ensure that the file is not hidden but it's just not visible.

I even tried to write the file in root of the sdcard but again same problem. Now I'm surprised that how is it possible that I can see the file in Android but not in Windows. In Android I've even checked the file contents and everything looks fine.

What could be the problem? Is the way I'm writing the file wrong?

PS: yes the Manifest permission android.permission.WRITE_EXTERNAL_STORAGE is added.

Artificiality answered 12/9, 2011 at 17:10 Comment(1)
ok, as recommended on meta I've posted a new questionArtificiality
A
6

Ok, I figured out why it was happening. Actually even if we press "Back" button, the program keeps running and unless I go to Settings > Applications > Manage Applications > "Force Stop" <application> I can't access the file written by this program even if it is on sd card and even if the filewriter has been closed.

This is just based on my observation and I'd like someone to post a better answer with facts and with solution.

edit: I'll update my question accordingly.

edit: as recommended on meta I've posted a new question

Can't see a file in Windows written by an android app on sd-card unless I “Force Close” the app

Artificiality answered 15/9, 2011 at 6:48 Comment(0)
J
4

If worse comes to worst disconnect, reboot and reconnect your Android device. The files should show up then.

Junto answered 22/8, 2012 at 4:31 Comment(2)
"Hello, IT. Have you tried turning it off and on again?" giphy.com/gifs/parents-computers-it-crowd-Oe4V14aLzv7JC/… Worked like a charm.Fetial
Only works once though, have to restart again for new files to show up.Fetial
L
0

I have found a workaround.

I wrote a routine to capture data from the phone accelerometer. I noticed if the file had a .dat or .txt extension I could not see it and could not copy it to my PC.

By not assigning a file extension to the file on the Android side, I found it would be visible from the PC. After copying it to the PC and adding a .txt extension, it could then be viewed on the PC.

Lovesick answered 27/1, 2018 at 1:6 Comment(0)
C
-4

To display hidden files and folders

  • Open Folder Options in Control Panel
  • Click Start, and then click Control Panel.
  • Click Appearance and Themes, and then click Folder Options.
  • On the View tab, under Hidden files and folders, click Show hidden files and folders.
Circumlocution answered 12/9, 2011 at 19:18 Comment(3)
Sorry if it wasn't clear, but I've already tried this! I'm sure that the file is NOT hidden.Artificiality
You can try showing 'System Files' as well. Or try viewing them from command prompt.Circumlocution
Thanks, already tried both, didn't help. Looks like it's an issue from Android side and not Windows side. :/Artificiality

© 2022 - 2024 — McMap. All rights reserved.