I don't really know the electrical side of things here, but I do know that there's a pretty simple method for using Spike relays: the Relay class.
Basically, you initialize one with the required port and the direction:
Code:
Relay relay = new Relay(PORT,direction); // direction can be Relay.Direction.kFoward,Relay.Direction.kReverse, or Relay.Direction.kBoth
Then you set it to one of four options (but it will throw an InvalidValueException if you set it to a direction it isn't configured for):
Code:
relay.set(Relay.Value.kOff); // 0v-0v, any direction
relay.set(Relay.Value.kForward); // 12v-0v, kForward or kBoth
relay.set(Relay.Value.kReverse); // 0v-12v, kReverse or kBoth
relay.set(Relay.Value.kOn); // 12v-12v, any direction