Code example for Constructor

Methods: isAccessiblesetAccessible

0
     * @param args the arguments of the constructor 
     */ 
    private static Constructor getConstructor(Class cls, Class[] args) {
        try { 
            Constructor c = cls.getDeclaredConstructor(args);
            if (!c.isAccessible())
                c.setAccessible(true);
            return c;
        } catch (Exception ex) {
            return null; 
        } 
    } 
 
    // private static final int TYPE_RFCOMM = 1; 
    // private static final int TYPE_SCO = 2; 
    private static final int TYPE_L2CAP = 3;
 
    private static final Method _createRfcommSocket = getMethod(
            BluetoothDevice.class, "createRfcommSocket",
            new Class[] { int.class });
    private static final Method _createInsecureRfcommSocket = getMethod(