I'm developping an Adobe Flex application.
I need to detect gps devices when plugged. Currently, it is a bad heuristic-based detection that is used (it tries to find specific files/directories). It uses the StorageVolumeInfo to discover plugged devices.
Thus, I'd like to know if there's a way to get the USB id with Flex.
Thx in advance
Right now, no, you can't do it natively in Air. You could however use a third party utility application to communicate with the device (java, c++, etc). Air USB device controls will be coming eventually after Adobe did a demo of using an xbox controller to play a game.
I tried looking for a release date, but to no avail.
I believe that the functionality you are looking for is only available in AIR. The following example shows all currently connected device names when starting up and also adds an event listener for devices that are connected at runtime.
import mx.events.FlexEvent;
private function onCreationComplete(e:FlexEvent):void{
StorageVolumeInfo.storageVolumeInfo.addEventListener(StorageVolumeChangeEvent.STORAGE_VOLUME_MOUNT,onMount);
showCurrentlyConnectedVolumes();
}
private function onMount(event:StorageVolumeChangeEvent):void{
trace(event.storageVolume.name);
}
private function showCurrentlyConnectedVolumes():void{
for each(var volume:StorageVolume in StorageVolumeInfo.storageVolumeInfo.getStorageVolumes()){
trace(volume.name);
}
}
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With