1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| public abstract class Acces implements AccesInterface {
public static Acces loadAccessory(Context context, UsbDevice device, Handler handler){
//Check the USB device which kind it is
if((device.getVendorId() == (int)0x04D8) && (device.getProductId() == (int)0xF777)) {
return new HID1(context, device, handler);
}
if((device.getVendorId() == (int)0x04D8) && (device.getProductId() == (int)0xF778)) {
return new HID2(context, device, handler);
}
if((device.getVendorId() == (int)0x04D8) && (device.getProductId() == (int)0xF779)) {
return new HID3(context, device, handler);
}
return null;
}
} |