3
votes

I have an old android phone (2.2) and I need to use it to transfer a (.tok) file to Basic Stamp micro RS232 using a USB-Serial converter in between. So bluetooth is out of question. My only option is to write to the USB port of my android and make the BS2 micro receive it.

I`ve never programmed Android so need some guidance as to how I do this, specially when my api level is 8. I need a simple program that reads a downloaded (from the processing local linux PC) file from sdcard and then send it to USB port without any processing. That file is then received by the RS232 port of bot.

2
+1 sounds like an interesting question :). You might need to do some bits in C, rather than java.Augusto
If you'll find solution in C (or C++) you can use JNI to call native function.Dmitry Zaytsev
I have a native c++ solution for writing to the linux /dev/ttyS0 port and then send to RS232 port .But not sure how to use it wrt android .Dayanand shetake
Why is Bluetooth out of the question? It seems to be exactly what you are looking for. I'd suggest grabbing a Bluetooth-to-RS232 converter and using that.Brad

2 Answers

1
votes

Android 2.2 API does not have USB host capabilities.

Host capabilities was not made available until Android 3.1.

This means you can't write an android program on your v2.2 phone that will control the USB communication.

I'm also guessing that even if you did update your OS, the phone doesn't have a USB-A port necessary to power the bus.

0
votes

no need "usb host", work an older android devices like 2.2 http://code.google.com/p/android-serialport-api/