It was used firstly to describe the Byzantine Empire, by it's citizens. The exact pronunciation was Rhomania (Ρωμανία) with the tone in 'i'.
That is because the medieval Byzantine Empire considered itself to be a continuation of the the ancient Roman Empire, not something new.
After all the free men of the Roman Empire were given Roman citizenship by the Constitutio Antoniniana of 212 CE, they were all called "Roman" regardless of their ethnic origin. Thus, the Greek-speaking inhabitants of the eastern part of the Roman Empire began to call themselves "Romans" rather than "hellenes", reserving the name "hellenic" (ellinika) for their language.
Greek-speaking adherents of the Eastern Orthodox Church continued calling themselves "Romanians" right through the medieval period, and indeed right up to the beginning of the 19th Century, when under the influence of Western European Philhellenes they began calling themselves "Hellene" again. Until then, Greek-speaking Christians regarded it as an insult to be called "Hellene", since that name implied that they were pagan idolaters like the pre-Chrisitan ancient Greeks.
The term "Romania" as used by the medieval Byzantine Empire was a territorial designation, meaning the territory that belonged to the Roman Empire, inhabited by Roman citizens. It survived right up to the 20th Century in the form "Rumelia", a diminutive form meaning "smaller part of the Roman territory"; the name referred to present-day Macedonia and southern Bulgaria.
The self-designation of the Greek-speaking eastern Christians as "Romans" was adopted by the Arabs as "Rumi", indicating any Christian. The name was also adopted by the Seljuk Turks, when they called the state they founded in Anatolia the "Sultanate of Rum"; that designation indicated that the Seljuk state was founded on terriotry that had belonged to the Roman Empire.
In the Ottoman Empire, the community of members of the Eastern Orthodox Church was called "Rum Milleti", the community of Romans. That name was given to all Eastern Orthodox Christians in the Ottoman Empire, regardless of their language or ethnicity; thus, Greeks, Bulgars, Vlachs, Serbs, Syrians, were all designated "Rum" by the Ottoman authorities.
Thus it is possible that the self-designation "Arumani" of the people who were called Vlachs by Slavic-speakers is derived from their membership in the Eastern Orthodox Church.
It is likely that the name "Romania" adopted by the kingdom formed out of the union of the Wallachian and Moldavian principalities was a conscious borrowing of the name by which the medieval Christian empire based on Constatinople designated itself.
On another matter, I would like to know if there is any history of the development of the modern Romanian language that is not distorted by political nationalism, whether pro-Rom,anian or anti-Romanian.
I would also be interested to know if there is any impartial, non-nationalistic explanation of why Romanian and its related dialects is the only surviving Romance language in an area where Latin was totally replaced by Slavonic languages, ie in Bulgaria and the former Yugoslavia.