 He studied at the Tashkent gymnasium, transferring to the Tashkent Teacher's Seminary in 1889.As a seminarist, Andreev often visited the Tashkent old city, where he became close with some students at the madrasa there.Through these students, he met the family of Kaziy Sharif-Khoji and Ubaidulla-Maksum Mudarris of the Ishan Kuli-dodho madrasa, whom Andreev persuaded to give him classes on Arabic, Persian, and Turkish literature.