His father, David Hannay (1794–1864), a member of the Speculative Society at Edinburgh University, 1813–14, and author of Ned Allen, or the Past Age, 1849, was engaged in business in Dumfries.
[1] Hannay entered the Royal Navy on 2 March 1840, on board HMS Cambridge, and served in her during the blockade of Alexandria in the Syrian war, and had therefore no share in the operations of Sir Charles Napier's squadron at Acre.
Very soon after entering the service, he began to devote himself to general reading, and even studied Latin with a priest at Malta.
With the instinct of a born journalist, he started a manuscript comic paper to ridicule the admiral and captains on the Mediterranean Station.
At the end of 1847, he worked with Henry Sutherland Edwards on Pasquin, a very short-lived comic paper, and the forerunner of the somewhat happier Puppet Show, which lasted from 1848 to 1849.
He soon improved his literary connection, and worked for papers of good position, for the quarterlies and magazines, till he became editor of the Edinburgh Evening Courant in 1860.
[1] During these years he published his best work, his two naval novels, Singleton Fontenoy (1850) and Eustace Conyers (1855), and the volume of lectures on Satire and Satirist, delivered at the Literary Institution, Edward Street, Portman Square, in 1853, and collected in book form in 1854.
Although he continued to write for papers and magazines, chiefly for the Pall Mall Gazette and the Cornhill, he published no more books.