Most cell phones have GPS receivers, but the map and navigation apps assume a
road map overlay, so using them in an actual lat/long/heading capacity is tricky.

Some ideas:

if your phone supports it, select the area where you're going and put it into
offline storage. if not, get an offline maps app.

To get an accurate north/south compass reading:
Solid state in-phone compasses are crap. If you have a magnetic clasping case,
yours is also probably ruined. To check compass calibration:
run sky map app
point phone at the sun, moon, or venus
if the app correctly shows your target sky body in the middle of the screen,
the compass is probably accurate and you can use it

Getting north/south if the compass is broken:
Two methods:

if you have enough clear ground to walk quickly, GPS lock may give you your
direction while you're moving (works on Android phones where the "you"
indicator is an arrow; does not work on phones where it's a circle).

if you can't walk quickly enough, drop a marker on the map, then walk a good distance and
drop another one. Ideally, you can still see the spot where your first marker was --
otherwise, you'll have to keep its rough direction in mind. The two markers form a line
segment on the map, which will tell you what direction you just walked.