Twilight for Android is an app that works like the previously mentioned f.lux. Looking at computers, tablets, and smartphones at night makes your brain think it’s still daylight. This can play a big role with insomnia. These screens produce a lot of light in the blue spectrum of light. The blue spectrum depresses melatonin. Melatonin tells our brain to shut down and go to sleep.
F.lux works with Microsoft, Apple, and Linux computers and with the iPhone and iPad.
Twilight works with Android phones and tablets.
Also, if you tend to watch t.v. late at night, you may want to get some special glasses.
I saw this at Lifehacker: Twilight for Android Changes Your Screen Brightness by Time of Day