Using accelerometer to trigger animation

Sorry if someone has posted a question similar but I’m looking to trigger an animation when the user shakes the phone or tablet. It would be nice to incorporate scaling thresholds like for instance depending on the intensity of the shake different animations will be triggered. But just a basic framework of how to trigger animations with phone motion would be nice. Thanks in advance. Extra info: android os

It seems there are two possibilities I found on the Scripting API. Unity - Scripting API: Gyroscope and Unity - Scripting API: Handheld

It doesnt seem there is any way for the interaction across all devices to detect “how much” shaking there is.