0

I have been going though the Android documentation searching for a way to identify a USB device (mass storage device or other) by its UUID, but I don't find one.

I looked at:

Non of these provide a sufficient method of determing the UUID.

Looking at some of the methods in UsbDevice, I would possibly go for getDeviceID(), however it

Returns a unique integer ID for the device. This is a convenience for clients that want to use an integer to represent the device, rather than the device name. IDs are not persistent across USB disconnects.

As a side note, I am using this library (libaums) to communicate with a FAT32 USB Mass Storage Device

How can I get the UUID of a USB mass storage device on an Android phone?

CybeX
  • 2,060
  • 3
  • 48
  • 115

1 Answers1

1

https://developer.android.com/reference/android/hardware/usb/UsbDevice.html#getSerialNumber() should uniquely identify the device.

Magnus
  • 390
  • 2
  • 12
  • 1
    Thanks for the answer -> will only work for API +21 `Added in API level 21`. I need to support API +16. Thanks again – CybeX Jan 09 '20 at 08:12