Your smartphone and your nervous system have the same problem, but running in in the opposite direction. The problem is conversion.
Your smartphone screen runs on electricity. But for your device to be of any use to you, that electricity has to be converted into light from your screen.
Your nervous system has the same problem, but in reverse: sensory neurons have to convert light back into an electrical signal.
Intuitively, you might expect this to be just one step. You could imagine that a neuron might just have an ion channel in the membrane that opens in response to light.
In fruit flies, there is indeed a molecule that changes when light hits it, and there is an ion channel that opens to cause an electrical current to flow into the neuron. But there is a whole series of links that chain the two together. And Hardie and Franze have discovered that one of those links is that cells in the eye have to twitch.
This movie shows that when you flash a light on one of the “facets” of the eye, it shortens for a moment. The brighter the light, the bigger the twitch.
Using mutants that lack some of the ion channels that are normally active when light is shone on the eye, they were able to introduce a new ion channel, gramicidin, into the sensory cells. Gramicidin does not respond to light: it responds to stretch. Once this was added to the sensory cell, Hardie and Franze were able to get the cells responding to light, suggesting that the shortening of the cells was needed for the cells to generate an electrical current.
They showed that the normal, light sensitive channels responded to changes in the shape of the membrane. They took individual cells, and changing the concentrations of chemicals so that water would tend to flow into the cell. Voila! Pressure changes without light, and the ion channels that normally respond to light still open.
All this suggests that the twitch within the eye is not just incidental: it is absolutely necessary for the fly to see light.
While mechanical stimuli are important in generating an electrical signal in fly eyes, the same is not true for your smartphone. Which is to say, no, you can’t charge your phone by shaking it.
Hardie RC, Franze K. 2012. Photomechanical responses in Drosophila photoreceptors. Science 338(6104): 260-263. DOI: 10.1126/science.1222376
Photo by Balapagos on Flickr; used under a Creative Commons license.