Can I change the LED intensity of an Android device?

HTC has an alternative API that supports this, however it’s only on HTC Sense devices, and as of Gingerbread they’ve changed the permissions so it’s only for their Flashlight app, not third party ones (unless you use root). But on 2.2 HTC devices you can use it by writing a string to /sys/devices/platform/flashlight.0/leds/flashlight/brightness. This controls … Read more

Use camera flashlight in Android

Every device is a bit different. Samsung especially likes to make things complicated for app developers. On the Galaxy Tab you should be good with: Camera cam; void ledon() { cam = Camera.open(); Parameters params = cam.getParameters(); params.setFlashMode(Parameters.FLASH_MODE_ON); cam.setParameters(params); cam.startPreview(); cam.autoFocus(new AutoFocusCallback() { public void onAutoFocus(boolean success, Camera camera) { } }); } void ledoff() … Read more

How to turn flashlight ON and OFF in swift?

Update #1: (torchActive isn’t returning the expected value; perhaps because it’s been modified) Update #2: For Swift 2.0 To toggle the flash from on to off (not just “on” as in mad pig’s answer), you can use the following method: func toggleFlash() { let device = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo) if (device.hasTorch) { do { try device.lockForConfiguration() if … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)