The diode D1 prevents the reverse flow of current to the wall adapter when there is no mains supply. Capacitor C1 is the output filter capacitor. Pin 4 of the IC is called the status output. When wall adapter input is present the status output pin will be high and this can be used to enable another auxiliary P-channel MOSFET (not shown in the circuit diagram).

Notes.
1 Assemble the circuit on a good quality PCB.
2 The wall adapter input can be anything between 3 to 28V DC.
3 The battery voltage can be anything between 2.5V to 28V.
4 Do not connect loads that consume more than 2A.
5 Maximum continuous drain current of Q1 (FDN306P) is 2.5A.
6 D1 (1N5819 is a 1A Schottky diode.
7 Q1 (FDN306P) is a P-channel MOSFET.