led

Showing flashing LED for foreground activity / screen on

前提是你 提交于 2019-12-01 09:12:36
I'm trying to turn the LED-flashing on for my activity in foreground, but it works only when the screen is off. Is it possible to turn the LED on for active activity with the screen on? My code: protected void led() { Notification notif = new Notification(); notif.ledARGB = 0xFF0000ff; notif.flags = Notification.FLAG_SHOW_LIGHTS | Notification.FLAG_ONGOING_EVENT; notif.ledOnMS = 800; notif.ledOffMS = 200; notificationManager.notify( LED_NOTIFICATION_ID, notif ); } At first Android LED indicator is very hardware dependent. Second - there is no API for managing LED instead of Notification class

Is it possible to programmatically turn on the Macbook Pro's keyboard backlight for individual keys?

本秂侑毒 提交于 2019-12-01 08:32:04
Although I have a feeling that this isn't technically possible, it's worth asking anyways. Is it possible to turn on the Macbook Pro's keyboard backlights for individual keys? I am working on a piece of grid-based software which allows the user to navigate around by pressing any key on the keyboard to position the cursor at that point in the grid. It would be very cool if I could somehow just turn on the backlight for certain keys to give the user an easy way to see the current position of the cursor. Is it even possible for an application to control the keyboard backlighting at all, let alone

Is it possible to programmatically turn on the Macbook Pro's keyboard backlight for individual keys?

♀尐吖头ヾ 提交于 2019-12-01 06:14:54
问题 Although I have a feeling that this isn't technically possible, it's worth asking anyways. Is it possible to turn on the Macbook Pro's keyboard backlights for individual keys? I am working on a piece of grid-based software which allows the user to navigate around by pressing any key on the keyboard to position the cursor at that point in the grid. It would be very cool if I could somehow just turn on the backlight for certain keys to give the user an easy way to see the current position of

LED Flashlight does not work on Samsung Galaxy Nexus

。_饼干妹妹 提交于 2019-11-29 06:54:23
I've got the following problem: My Flashlight app works fine on my Samsung Galaxy S2 but unfortunately not on the Samsung Galaxy Nexus (problem: flashlight ignores the button-click -> no reaction, no light, no crash, no exception). I've read "LED flashlight on Galaxy Nexus controllable by what API?" here in stackoverflow but it did not help me since my problem still occures. This is my code-snippet to control the light: final Button FlashLightControl = (Button)findViewById(R.id.ledbutton); FlashLightControl.setOnClickListener(new Button.OnClickListener() { public void onClick(View arg) { if

Can the Android handset LED be manipulated without using a Notification object?

南笙酒味 提交于 2019-11-28 12:09:10
I want to control the LED on an Android device with more control than is offered by the Notification class. Notifications allow you to change the rate of flashing; e.g. 300 milliseconds on, 1000 milliseconds off, but that's it. Essentially, I would like to turn the LED on and off at will at arbitrary times. Does anyone know if this is possible? The API does not seem to say so. Does it depend on the specific hardware? I haven't tried this in code, but the SDK shows this: To turn the LED off, pass 0 in the alpha channel for colorARGB or 0 for both ledOnMS and ledOffMS. To turn the LED on, pass 1

Android: Keep camera-LED on after screen turns off

谁说我不能喝 提交于 2019-11-28 10:22:23
since i'm at the beginning with Android coding i hesitated to post my question, but now i'm at the point where i can't resist. I have a service which turns on the camera-LED onCreate: @Override public void onCreate() { // make sure we don't sleep this.pm = (PowerManager) getSystemService(Context.POWER_SERVICE); this.mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "SleepLED"); this.mTimer = new Timer(); this.mTimerTask = new TimerTask() { public void run() { // turn on the LED setFlashlight(Camera.Parameters.FLASH_MODE_TORCH); mWakeLock.acquire(); } }; // Get the notification-service

Disable/enable notification led

强颜欢笑 提交于 2019-11-28 09:33:39
Is it possible to programmatically disable and enable the led indicator light on an Android device? I am not referring to just turning it on and off as in a notification. I did not see anything in the api that would do so. I am guessing this is hardware specific if it is possible at all. I have not seen any APIs for dealing with the LEDs other than the Notification class. Yea sure there is a way... android.provider.Settings.System.putInt(getContentResolver(), "notification_light_pulse", 1); 1 - indicate on state 0 - indicate off state 来源: https://stackoverflow.com/questions/3304971/disable

LED Flashlight does not work on Samsung Galaxy Nexus

情到浓时终转凉″ 提交于 2019-11-28 00:22:19
问题 I've got the following problem: My Flashlight app works fine on my Samsung Galaxy S2 but unfortunately not on the Samsung Galaxy Nexus (problem: flashlight ignores the button-click -> no reaction, no light, no crash, no exception). I've read "LED flashlight on Galaxy Nexus controllable by what API?" here in stackoverflow but it did not help me since my problem still occures. This is my code-snippet to control the light: final Button FlashLightControl = (Button)findViewById(R.id.ledbutton);

How to use camera flash/led as torch on a Samsung Galaxy Tab?

故事扮演 提交于 2019-11-27 11:23:37
I'm facing to a problem with a Samsung Galaxy Tab. I want to use the camera flash as torch. Does anyone know how to enable it ? Hereby a code that works to enable/disable the camera flash on a HTC Desire but fails on Samsung Galaxy Tab. FlashLight.java : package com.example.FlashLight; import android.app.Activity; import android.hardware.Camera; import android.hardware.Camera.Parameters; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class FlashLight extends Activity { private final

Camera.Parameters.FLASH_MODE_TORCH replacement for Android 2.1

我的梦境 提交于 2019-11-27 08:30:24
I am trying to write an app that requires the LED flash to go into torch mode. The problem is, Android 2.1 does not support this mode and therefore I cannot support the platform yet. Wouldn't be an issue, but I am writing it for my fiance and her Epic 4G only has 2.1 right now. I found some code samples that use some undocumented API calls and therefore work on the Motorola Droid and such, but they do not work on the Epic. Does anyone have some suggestions on where to look to find code that should help me get this working? mmeyer I'm finding that torch mode is generally working fine on 2.1 but