On July 22.1802 ; Emperor Gia Long conquers Hanoi and unified Viet Nam, which had experienced centuries of feudal warfare.