Hello, I am having a problem getting the MTP service to refresh the
file list in Windows. Since USB mounting is not available on newer
devices, they use MTP to transfer files.

I am using Windows 7, Galaxy Nexus (also a problem on Xoom, probably
all 3.X and higher devices).

Here are steps for the problem:

1. Connect android device. The folders and files for the sdcard
equivalent show in Windows.
2. On the device, run a java program that will create a file (source
code below)
3. (BUG) The file list is not updated in Windows. Does not show the
new file, does not update file sizes if you modified an existing
file.

Disconnecting/reconnecting usb table does not fix this. You must
reboot the android device for Windows to update the file list.

Here is a simple code sample to create a file, which shows the problem
above:

// Sample code
File file = new File("/sdcard/test.txt");
BufferedWriter buffer = new BufferedWriter(new FileWriter(file,
false));
buffer.write("Test");
buffer.close();

If you look on the device using a file manager, the file does exist.
The adb tools are capable of retrieving it. Windows is not. You must
reboot the device to get it.

This causes problems with updated files as well. The new file size is
not seen in Windows, so if you copy the file off the device, you copy
the new data, but only up to the old file size. So most likely the
file is now corrupt, depending on what type of data it contained.

I see that pictures and such show up immediately (using the camera).
So there must be some way around this. I also see that a file manager
program I downloaded will cause Windows to see files I copy and delete
using it (ASTRO file manager).


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to