Basically, how it works is, it takes the time, the date, and the geographical location and predicts the position of the sun/moon (probably from an algorithm as the aforesaid app did not connect to the net) wrt to a compass. Now the direction of the qibla is overlaid on the image and a person can align his mobile with the sun and get the correct qibla direction.