A single atom detector integrated on an atom chip: fabrication, characterization and application