What I am trying to do?
Using the sensor of Android, I have collected lot of acceleration values when some diabetic patients were running to do physical
You can get the direction just by using simple math- y/x=tan theta, where theta is the angle from origin in the xy plane. Similar math can get you the other angle involved. The problem for you is all that is relative to the phone, not to the user. So if his phone was at an angle in his pocket, you won't get the answers you want. Worse if it was upside down.
That said- I question the actual need for this. If you're trying to get relative effort of their exercising, magnitude should be enough. If you're trying to do something like mapping, acceleration data is too noisy for accuracy.
You should consider the directions of each component of acceleration. Think about A 3D vector. There’s no way to determine positivity or negativity; it’s direction is denoted by a unit vector pointing the same way. So in essence, 3D vectors (total acceleration) are not positive or negative (unless of course all 3 components are one or the other). So you should consider the positivity of each in your code.