Why can't I use a gyroscope/accelerometer only as a compass? I am seeing this from the usual smartphone sensors. These sensors (Android here e.g.) take the magnetic field data as input. That is okay, but some phones do not have a magnetic field sensor (they cannot display a usual compass app e.g.).
Now they still have a gyroscope? This device, AFAIK, lets the app determine the position of the device in X, Y and Z direction (or even with more axes). This sounds as if I could also use it as a compass. Maybe it needs to be calibrated one time, so I know that some vector is the vector pointing north, but then
So could apps use this? Or if not: Why can't they?
Basically that is just a question for whether this fallback/workaround for phones without magnetic sensors is possible.
You can assume any other "usual" sensors in nowadays smartphones to be available, so when you need an additional sensor or e.g. GPS, assume you can use that.
 A: In theory you could.
A mems gyroscope  - assuming you could hold it flat and still enough for long enough - can sense geographic North. But you need a low noise sensor and some clever filtering software.  See A New North-seeking Method Based on MEMS Gyroscope 
They work by essentially measuring the sideways force of the Earth pushing on you as it rotates - the direction that this force acts about is the pole.
Spinning wheel gyrotheodolites are used underground to determine North when you can't use magnetic compasses because of magnetic rock.
edit: You can maintain a heading (although you won't know where the heading actually points) using accelerometers - the device is called an inertial measurement unit. Car sat-navs use them to calculate your position when you lose GPS coverage in a tunnel or high buildings. But they do gradually drift especially if they are subject to high accelerations - like being hand held by someone walking.
See Are gyroscopes the only way to maintain the orientation?
