Inertial Guidance system?

If we were going to use the accelerometer and gyro to keep track of our X and Y position on the field. How exactly would we code this? I know based on the Java docs that the Gyro finds the angle by integrating the rate, so is there a way to do this with the Accelerometer to find the position?
Also, has anyone done this before and can tell us how accurate this would be? or is it probably better to stick with Sonar sensors/Camera vision tracking?

For the accelerometers, you need to integrate twice to get to position. We’ve tried before and never gotten acceptable results.