To find the first Muslims of India, you must visit the first mosque of India,
Legend has it that King Perumal became Muslim and decided to go visit Prophet Mohammad. He travelled to the Hijaz to meet the Prophet Mohammad. On the way back, King Perumal passed away. Before passing away, Cheraman instructed his companions to go on with the journey and establish a masjid in Kerala
The Masjid is said to have been established in the year 629CE. This means that it was constructed just 7-8 years after the hijrah of the Prophet to Medina. Some people doubt this story, but it is a fact that Malabar was linked to Arabs through maritime trade. So if it was not within 10 years of hijrah then at least 100-200 years after Islam spread in the Arabian Peninsula it was well established in Malabar.
On a moon-lit night the king while walking on the rooftop of his palace along with the queen saw the moon suddenly splitting into two halves. Later he came to know through the Arab traders that a prophet called Muhammad had wrought a miracle on that fateful night, and sundered the moon before a crowd of dazed spectators. Impressed by this new messenger of God in Arabia, the king set out for the holy land after dividing his kingdom and assigning various territories to local chieftains to ensure smooth governance. In Arabia he met the Prophet and embraced Islam in the presence of Abu Bakr Siddique, who later became the first caliph. Cheraman, who took a Muslim name, Tajuddin, died on his way back to India and was buried on the shore of the Arabian Sea at Salalah in the Sultanate of Oman. It is said that he had earlier written letters to the local rulers of Malabar and sent it through his ministers along with Malik bin Dinar, a companion of the Prophet. In the letters he had asked them to “receive the bearers of the letters and treat them well and help them to construct mosques at Kodungallur and elsewhere”. The rulers of Kerala honoured the letters and permitted Malik Bin Dinar and his fellow Arab traders to build mosques in Kerala. The mosque built in the early 7th century at Kodungallur, known as Cheraman Malik Masjid, still exists with its original structure and is said to be the oldest mosque in the sub-continent. It is named after both Cheraman Perumal and Malik bin Dinar.Another mosque built during this period was the Malik Dinar Mosque.
William Logan accepted the story as authentic but changed the date of conversion from 345 A.D to 825 A.D. The Perumal, however, could not have met Muhammad (570-632 A.D) either in 825 A.D or in 345 A.D. The mosque at Kodungallur, purportedly built on the instruction of the last Perumal in 629 A.D exhibits the style of middle Chola architecture and a team of historians who studied its foundation safely placed it in the 12th century.The mosque at Madayi, one of ten believed to have built at the instruction of the last Perumal, had a plaque attributing its foundation to Hegira 518 i.e., 1124 A.D
Some have argued that it is not Rama Varma Kulashekhara but Bhaskara Ravi Varma who is the protagonist of this legend. However, the life of Bhaskara Ravi Varma is well documented and there is no report of his having left his empire. Another school of thought believes that he converted to Buddhism or Jainism and there is yet another version according to which Perumal converted to Christianity, went on a pilgrimage to Mylapore, died there and is buried beside the tomb of St. Thomas, the Apostle. Prof. A. Sreedhara Menon concluded that the legend of Rama Varama Kulashekhara’s conversion originated as a figment of imagination or as a case of mistaken identity and continued to be reproduced without critical examination