Khvoyka was born on 21 February 1850 in the village of Semín in the Kingdom of Bohemia (then part of the Austrian Empire). After graduating from the Academy of Commerce in Chrudim, he lived in Prague for a time before emigrating to the Russian Empire. From 1876 he lived in Kyiv and worked as a teacher. He turned his attention to archaeology in the 1890s and excavated around Kyiv and the Dnieper region. He was one of the founders of Kyiv's Museum of Antiquities and Art, now the National Historical Museum, and the first curator of its archaeological collection.