Smartphones contain lots of useful components for celestial navigation such as a gyroscope to measure angles and multiple ways to establish the current time accurately. There are apps that can attempt this such as "CamSextant" but ironically, the big challenge is actually the camera which is wide angle and hard to use for precise observations.
There are a few projects which marry cheap zoom lenses with smartphones (e.g. https://www.instructables.com/ISextant-Project/) to overcome this.
You may also be interested in this app which compares GPS positioning with sextant altitude allowing you easily detect errors with either: http://reednavigation.com/GPSAntiSpoof/