I have two issues with a serial program on mobile device:
- InputStream.available() always returns 0 according to documentation. Can't use DataInputStream because the data might be a file and not a string. If I simply call the read() on the InputStream it'll block the IO operation if the byte(s) doesn't exist on the other side. In addition, I don't know how much is the size of input data. So how do I find if data is available at port and how much is the size of available data?
- I'm using hyperterminal to test the serial port and mobile is only responding to AT commands, like ata and atd. So any string like "hello" is ignored and my app can't see it. so is this true? or I'm missing something? how can I make the data visible to my app?
well any suggestion? code snippets maybe?