A simple application to record sleep activity.
Run the application, turn off the display and leave the phone on his bed during sleep. It will measure all shocks and save them to a file sleep.log on the memory card. The file can be viewed or let him handle in any program (Matlab, Scilab, Gnuplot, ...).
Possible problems:
Do not measure
Apparently, the phone does not have a gyroscope.
Do not measure over off displays
This may happen on certain types of telephones. Tell me the name of your phone.
Where to store the measured data?
In the file "/storage/sdcard0/sleep.log". On the device, it may be, for example. "Internal storage / sleep.log" or "/storage/emulated/0/sleep.log".