Hey there,
I'm developing an app for reading data from a USB attached device on 
honeycomb (3.2).
The device reads data from an external infrared meter prepares data and 
shares them over mass storage. It means the USB device is mounted as mass 
storage device. As it updates and creates some files by itself the android 
file-system doesn't seem to recognize the changes.

The only solution seems to mount/unmount the device over the settings menu. 
After "remounting" all data is updated as this is the most effective way to 
force android to refresh the file-system-cache. But this solution is not 
practical for daily use.
So I looked for a solution to mount/unmount USB storage by code and found 
the "MOUNT_UNMOUNT_FILESYSTEM" permission, google led me to some 
information about IMountService but I'm unable to find any documentation 
about IMountService on honeycomb. Every implementation or use of this 
service seemed to be on Android 2.x and might need root. As I'm using a 
ASUS Transformer for developing I saw that ASUS provides a widget to 
unmount mass storage devices which is located next to the clock in the 
bottom right corner. What leads me to assume that there has to be an 
Interface to mount/unmount devices. ASUS doesn't support third party 
developers and doesn't want to give me some information about that issue.
I had no success trying to implement the MountService with the 
documentations I found even on a rooted device.

*All this led me to the assumption that IMountService is only available for 
OS developers (like Asus, Acer and so on) and not for SDK developers. Am I 
right with this?*

Trying to find another way to force honeycomb to refresh the 
file-system-cache and re-read data from the device a colleague mentioned 
that creating a new file in the folder I try to read might force honeycomb 
to synchronize device data and cache data. Try and Error again and again no 
success I can see the created file appearing in different file explorers 
and disappearing when deleted but all other files doesn't seem to be 
updated.
Another thing might be that all data produced by the USB device have a 
time-stamp from 2004 or 2005 so honeycomb might be intelligent enough not 
to update these files as they have no current timestamp. Trying to use 
"Runtime.exec()" to run a touch command and update the time-stamp led to 
errors on unrooted tablet and had no effect with a rooted tablet.

Now the question is: *Is there any documentation how to access the 
MountService or equivalent on honeycomb as an SDK developer?* The 
developers doesn't seem to provide permissions that can not be used by any 
API call and the 
reference<http://developer.android.com/reference/android/Manifest.permission.html#MOUNT_UNMOUNT_FILESYSTEMS>clearly
 says that this permission is used to mount / unmount file-systems. 

*Or is there any other way to force honeycomb flushing the 
file-system-cache and reload all files?*

Maybe there's an option in ICS (4.0) as this version is completely open 
source and honeycombs source code was only provided to the vendors.

Thanks for reading this and hopefully giving me a hint ;-)

-- 
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