I am trying to obtain the MAC Address of the Android Device on which I am executing my Qt android app code. It is giving the correct MAC Id when I am running it on Windows Desktop but on Android Device it is showing the MAC address as 00:00:00:00:00:00. Android Device is connected via USB to the desktop. Is there any way to obtain the MAC ID of the device using Qt Programming? Here is my code snippet:-
QNetworkInterface networkInterface;
QString m_strHWAddress1;
QList<QNetworkInterface> list1=QNetworkInterface::allInterfaces();
foreach(networkInterface, list1)
{
if(networkInterface.flags().testFlag(QNetworkInterface::IsUp) && !networkInterface.flags().testFlag(QNetworkInterface::IsLoopBack))
{
m_strHWAddress1 = networkInterface.hardwareAddress();
}
qDebug()<<"hadd: "<<m_strHWAddress1.toStdString().c_str();
}
Thanks in Advance!!