A compass points to magnetic north, which differs from true north (the direction of the North Pole and of the sky's pole) by the magnetic declination. Phones report directions from magnetic north, so this page adds the declination you enter to show true azimuths, which is what the Sun and Moon positions use. Across most of India the declination is small, a degree or two, but it reaches 10° to 20° or more in parts of North America, Europe and the far south. Look up the value for your place with the NOAA magnetic field calculator (it opens a NOAA page; this page itself sends nothing).
The phone's motion sensors report its orientation as three angles: a turn about the vertical (alpha, the compass heading), a tilt forwards and back (beta) and a tilt sideways (gamma). The page turns these into the direction of the line that comes straight out of the back of the phone, the way the camera looks, and expresses it as altitude (degrees above the horizon, negative below) and azimuth (degrees round from north through east, so east is 90°, south 180° and west 270°). The same angles are what an altazimuth telescope mount uses.
The Sun and the Moon positions come from the astronomy-engine library for your place and the current time, including atmospheric refraction near the horizon. The arrows and the "turn" hints point the shortest way to each of them.