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

B4X founder
Staff member
Licensed User
Longtime 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.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…