It depends on your application... If your goal is to calculate the direction of the phone using accelerometer, or to calculate the acceleration of the smartphone.
Here is a link that explains the situation: https://physics.stackexchange.com/questions/316178/how-to-remove-gravity-component-from-accelerometer-x-y-readings