Currently the bridge generates an id (an incrementing integer) for each new object in python. This works fine for most cases.
However if a constructor from java returns more than one new object this pattern fails... eg https://developer.android.com/reference/android/hardware/usb/UsbManager#getDeviceList() returns a hashmap of devices.
A better strategy may be to store items using their hashCode .
Currently the bridge generates an id (an incrementing integer) for each new object in python. This works fine for most cases.
However if a constructor from java returns more than one new object this pattern fails... eg https://developer.android.com/reference/android/hardware/usb/UsbManager#getDeviceList() returns a hashmap of devices.
A better strategy may be to store items using their hashCode .