Know the direction (S, N, E, OE) with the acceleration sensor

Hello, good morning, I’m making an application which has a market that if you look north, my image looks to the north and so to the south, east or west, but only this works with cell phones that have GIROSCOPE, my ask how can I use the axes, X, Y, Z of the accelerometer to solve my problem.

Thank you

Start here:
Then you might land here:
Which leads you here:

All 3 options should work.