How did I get a Helicobacter pylori infection? Is H. pylori contagious?

H. pylori lives in the stomach lining and causes chronic inflammation called gastritis, acting as a strong risk factor for both ulcer formation and stomach cancer. But how does someone get infected with H. pylori? Can people spread H. pylori by kissing?