How the direction is found
The Qibla is the direction of the Kaaba in Makkah, at about 21.4225° N, 39.8262° E. Prayer Pal takes your location and calculates the starting direction of the shortest path across the Earth's surface from you to the Kaaba — the great-circle route.
Your phone's compass then turns the needle as you turn, so you can face it. A compass reads magnetic north, which can be several degrees away from true north depending on where you are, while the Qibla direction is measured from true north, so Prayer Pal corrects the compass for your location. The calculation and the correction both happen on the phone itself, which is why it keeps working offline once your location is known.
When the compass asks to calibrate
A phone's compass can drift near metal and electronics. When its reading is unreliable, the app shows Calibration Needed and asks you to move your device in a figure-8 pattern. Hold the phone flat, away from magnets, speakers and metal surfaces, then turn slowly until the needle settles. That help appears right on the compass dial.
On iPhone, the first time you open Qibla the app asks you to enable compass access; tap Enable Compass to allow it.
