DC Supply and Battery in parallel
This circuit may do at least part of what you want. V1 is the adapter and V2 is the battery. 

D1 and D2 prevent current from flowing back to either source. When S1 is closed (before the relay opens), the diodes D1 and D2 feed along the higher of the two sources to the output. When the relay opens, the battery (V2) is disconnected so even if it is higher than the adapter it will not be drained. It does not matter how long the relay takes, since the diodes will allow one or the other source to power the board during the transition. 

There's nothing here that would allow the battery to be charged- not enough information, so this is a yet incomplete answer.  







simulate this circuit &ndash; Schematic created using CircuitLab