I created a simple app to demonstrate how you could detect taps on the back of a device using the z accelerometer. The app samples z-accel 50 times per second and uses a washout filter to approximate the rate of change of acceleration. That way, the value is centered at zero regardless of the orientation of the phone. When the phone is tapped, the filtered acceleration momentarily spikes before returning to zero. The logic looks for single a high value surrounded by low values. The tap does not have to be very hard.
The code can be found here, on GitHub: https://github.com/InvaderZim62/BackTap