Android Question How to edit device_filter.xml for USB at runtime?

welu1805

Active Member
Licensed User
Longtime User
Hi all,

I try to work with USB devices for Midi and use MidiUSBManager. With this command I check if the USB device has permission:

B4X:
Dim Manager As USBManager
If Manager.HasPermission(Device) = False Then ...

If the device is already in device_filter.xml the permission will be granted. But if the user uses a new device which is not in the device_filter.xml no permission is granted.

How can I add the new device programatically to the device_filter.xml at runtime? The user can not manually edit the device_filter.xml and recompile my app!

The vendor-id and device-id can I get with: Device.VendorId and Device.DeviceId

Thanks for help
Lutz
 

welu1805

Active Member
Licensed User
Longtime User
I feared it :(

I know the Manager.RequestPermission command. Is there a possibility to hide this dialog and answer automatically with "Yes" or "Connect" so the user has not to do anything?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top