How can i communicate Android device with using com port?

1.7k views Asked by At

I am working on Android project using Qt and i need to communicate between mobile phone and computer. I want to make little demo with using Putty.I want to send data mobile phone over USB cable and display on Putty to ensure communication. When i search Serial port on mobile phone const QList<QSerialPortInfo> &info = QSerialPortInfo::availablePorts(); info.count() is equal zero. Application can not find any serial port on mobile phone but i can send or receive data (drag and drop) over USB cable. How can i communicate to Android device with using Serial Port?

Thank you for answers..

2

There are 2 answers

0
Ahmet Serdar On BEST ANSWER

I have discovered what i did wrong. The phone does not support OTG feature, so i could not see serial port by using qt serialport library. If anyone faces this problem, i hope this works for him/her.

0
Marcos G. On

Not many mobile phones that come with a native serial port as far as I know.

If what you mean is you have a USB serial port connected to your mobile phone through an OTG cable maybe you need to take a look here. There is also an app on the Play Store based on the same code.