In 1861 he was elected into the local committee and in 1864 was elected mayor.
He cooperated with the occupying Prussian forces during the war between Austrian-Prussian War.
He managed to minimise the damage caused by the soldiers.
After a peace was concluded, he was decorated by the Emperor.
In 1868 he managed to receive a permit to create a main school in Moravská Ostrava.
In 1869 he managed to organise a railroad to be placed between Ostrava and Frýdlant.
Also, a public gaslight was established in 1870, a new city graveyard was opened in 1871.
However, his investive activities caused a deficit on 170,000 gold pieces to be made, resulting in Anderka not being named mayor in 1873.
He however remained in communal politics, serving in the local committee, dying on 7 April 1886, due to a lung disease.
He was succeeded by Konstantin GrĂĽnwald.