Android Question usb entery

yaniv hanya

Active Member
Licensed User
Is there a way to determine whether a device such as a disk or key is connected to the device usb entery?
 

Erel

Administrator
Staff member
Licensed User
B4X:
Sub Process_Globals
   Private manager As UsbManager 'USB library
End Sub

Sub Globals
End Sub

Sub Activity_Create(FirstTime As Boolean)
   If FirstTime Then
       manager.Initialize
   End If
End Sub

Sub Activity_Click
   If manager.GetDevices.Length > 0 Then
       Log("Something is connected")
   End If
End Sub
Finding the device type will require asking the user for permission and will make it a bit more complicated.
 
Top