Android Question usb entery

Discussion in 'Android Questions' started by yaniv hanya, Jul 28, 2019.

  1. yaniv hanya

    yaniv hanya 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?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Code:
    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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice