Need advice, QT app communicating with android service

396 views
Skip to first unread message

P Rein

unread,
Aug 12, 2014, 2:46:23 AM8/12/14
to andro...@googlegroups.com
Hello,

I am working with some people that have made an app in QT that communicates with a device through serial port (they look for tty files in /dev/). Their software works fine on a PC with linux. They want to port it on a tablet, the only problem they seem to have is the serial interface. Since most tablets don't have RS232 on them .. they want to use USB communication. After several days of tests the only way I could imagine things working is this : A service written in java works with the USB host (I have this working by now) and “translates” it to another protocol that QT apps can handle. For some reason android, when given a CDC device, doesn’t create a tty file in /dev/ and I found out QT doesn't handle USB host yet.

I need some advice on what should my service send/receive data to, so that their app can be rewritten to use instead of tty-s. We are thinking of using a socket, but since I am fairly new to linux, android and qt I have the sense my decision might not be the best one.

Thank you.

BogDan Vatra

unread,
Aug 12, 2014, 8:17:29 AM8/12/14
to android-qt
Hi,

I don't believe you'll have access to /dev/tty files on Android. If
you want to communicate via USB then you must use Android USB API (and
connect them to Qt world using JNI).

Cheers,
BogDan.
> --
> You received this message because you are subscribed to the Google Groups
> "android-qt" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-qt+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

P Rein

unread,
Aug 12, 2014, 10:38:50 AM8/12/14
to andro...@googlegroups.com
The tablet I was working on was rooted so I had access to dev/tty. But android doesn't create a tty file for USB CDC devices anyway.

Is there another suggestion, other than JNI ? 

eric MONROSE

unread,
Aug 12, 2014, 10:52:55 AM8/12/14
to android-qt

P Rein

unread,
Aug 12, 2014, 11:24:47 AM8/12/14
to andro...@googlegroups.com
I am sorry, but this makes no sense.

eric MONROSE

unread,
Aug 12, 2014, 11:59:45 AM8/12/14
to android-qt
I encounter the same problems avecQt android. Qt on PC no problems with the serial port. Either you have a USB port on your android device allows you to connect a USB-RS232 converter on your android device, hoping it to be recognized, or both for the same price, buy a converter series or series-wifi -Ethernet (about ten dollars) to be able to connect to your local network device you wish to manage and effectively control it very quickly using Qt network layers. If you are pragmatic, why do you persist with qt do the work Java will be even easier.

I hope you find more meaning to my proposal. If it does not, not be taking me too briefly. Expand your thinking, it also allows me to move forward.

P Rein

unread,
Aug 13, 2014, 2:27:09 AM8/13/14
to andro...@googlegroups.com, eric.m...@gmail.com
How did I mislead you into thinking I want to use Ethernet to communicate with an external machine ? I have an android tablet that needs to communicate with a device that is a USB CDC device. There is an app written in Qt that was not initially written for a tablet but it seems to work fine except the communication part. My task is to make a service (on that same tablet) that handles the USB communication and gives it to the Qt app. IF I use sockets, my service would be the server and the Qt app will then make calls to it (both on the same tablet). 
I am asking if using sockets for this task is the best method. Is there another protocol I could be using to make a service communicate with an app (Qt app in this case) ?

P Rein

unread,
Aug 20, 2014, 10:45:16 AM8/20/14
to andro...@googlegroups.com
Has noone encountered such a problem before ? Should I be flattered ? :D
What had to be done is done but I hoped to find a better way here.
Reply all
Reply to author
Forward
0 new messages