10dof HMC5883L heading problem

Hi everyone,
so lately I've started using the 10dof HMC5883L compass module and it's been working great so far.
The problem I'm facing right now is the following:
the magnetic values (x, y, z) are under a big influence of other electronic devices (e.g. smartphones, the Arduino UNO itself, etc.)
Is there a software solution for this problem?
Im thinking of making a "tinfoil head"thingy for the 10dof, but I think that will shield the HMC5883L from measuring any magnetic values at all.

Greetings,
Benno

It is essential to calibrate the magnetometer in the environment in which it will be used, or the headings will be inaccurate or completely useless.

Overview here: Tutorial: How to calibrate a compass (and accelerometer) with Arduino | Underwater Arduino Data Loggers