In 1812, he departed for Brazil, to join the Cortes, where he conquered, through his intellectual abilities, the confidence of the government-in-exile and the Prince Regent. Stockler was residing in Rio when, following the death of Queen D . Maria, the Prince Regent was acclaimed as King D. VI. He was commission by the Lisbon Royal Academy of Sciences to present a speech in name of the institution during the course o f the kings investiture, which was published in the first tome of "Memórias da Academia".