Code example for UsbManager

Methods: getDeviceList

        UsbDevice d = l.get(n);
        return d;
    private HashMap<String, UsbDevice> defDevicesList(UsbManager m) {
        HashMap<String, UsbDevice> d = m.getDeviceList();
        return d;
    // Getters and setters. 
    public boolean getConnection() { 
        return mConnected;
    private void getPermission(UsbManager m, UsbDevice d, Context context) {
        PendingIntent p = PendingIntent.getBroadcast(context, 0, new Intent(
                ""), 0); 
        if (!m.hasPermission(d))
            m.requestPermission(d, p);
Connect your IDE to all the code out there  Get Codota for Java