[Q] How to make Android send data through USB port? - Android Software/Hacking General [Developers Only]

Hello,
I'm planning to do some dev stuffs in mobile's accessories hardware.
My idea is :
- I need an Android software install on my phone (actually I'm using HD2 running Android 2.2). For example : My software is simply a textbox with one button. When I click on the button, the software get the textbox content, encode it in to binary signal and send it toward the USB port of my phone
- I will make a circuit board to handle that binary signal, with a micro processor chip, I can convert that signal and show it on a LCD the content which I have just sent from my phone
I have some experience in Android software programming, but I'm stuck in sending signal through USB port in Android? So may someone here can help me with an example? or an suggestion of the library which I can use to open USB port?
Thanks in advance for your help

Did you get this to work? I am planning to use that same approach for controlling a PIC circuit that is connected via USB to the phone.

Unfortunately, I did not work it out =((

same problem
i have the same problem, i have to send a file by usb port. Im using ttyACM0 but its not working =/

Related

[Q] Serial Output on Android Phone

Hello! I am new to this forum, I figured you guys may be able to provide some input on a project I want to undertake.
I would like to use an Android phone (Probably an unlocked Chinese model running 2.2) as the brains for a remote control project. Since the phone has a GPS, Camera, and GSM connectivity all built in (and low power consumption) it seems it would be the perfect solution. To control the device, I was hoping connect a serial/usb servo controller (Pololu Micro Maestro) to the phone. However, I am having trouble finding any information on the viability of connecting a serial device to the phone – can this be *reasonably* done?
I appreciate any information you can provide!
try a google search for bluetooth to serial adapter. that will be the quickest/easiest/most likely to be workable hack.
next up would involve USB-Serial adapter(choppin wires to attach your necessary connector), generics are dirt cheap, but you would need kernel support. drivers/usb/serial/ is most likely where you would be looking, most of the generics use prolific chips. quick check would be to lsusb in a terminal and see if something pops up.
yea id go with bluetooth - serial adapter.
That is a good idea... I will do some checking. Thank you!

Usb on the go

Hello if any of you have heard of the USB-ON-THE-GO specification you will know that it is basically connecting USB perphierals to a mobile device.
I have had a desire to connect USB FLASH DRIVES & WEBCAMS etc. to majority of my handsets and have worked out that their is a way for the HTC Hero using something from THE DROID and some modding involved.
However, I am unsure if it will work with the HTC CHACHA and require some information on the following:
-TYPES OF WIRES NEEDED
-TYPES OF DRIVERS NEEDED
-COMMAND LINE NEEDED
Android is a variant of Linux so therefore it has the ability to recognise all common devices: Keyboard, Pendrive, WebCam and Hardrive etc..
There is some sort of way of doing this and not affecting your hardware entirely at all- in short is there a way or does the Droid method work on this handset??
Thanks,
TechMayhem (FreakyTech ROM)

[Q] USB/ Bluetooth development for special devices.

I just bought a TF700. I've never written a single line of code for an Android device. I've done some Linux development.
I want to build an app to control a Zoom HDZ300 AM/FM radio. It can be controlled remotely by simple messages sent to its serial port, but apparently the sending device does need to handle flow control.
The sound output is regular analog stereo. That will go into an amplifier, not my Android.
Does the Android operating system (Ice Cream Sandwich or Jelly Bean) allow programmers direct access to the USB or Bluetooth stacks so that one can enumerate devices and send/receive raw data to/from them ?
I am hoping to use the ASUS stand alone USB adapter, a USB hub and a USB serial port adapter to interface to the radio. I'd put a link here to the device, but I'm a newb and newbs are prevented from linking in their first 10 posts.
Does anyone see a problem with doing this ?
How would a Bluetooth Serial adapter work instead ? From the OS point of view, which would be easier/better to use ?
Thanks
I'd also like to connect and use an external USB sound "card". What are the issues with doing that ?
Thanks

[Q] Superpad Flytouch 7/8 serial over USB host?

Hi,
I'm trying to learn about serial communication with devices from an Android tablet via USB host mode. I have a tablet, I have the devices, I have the apps... they just won't talk. It's most likely something to do with the firmware on my odd tablet, or maybe I'm just missing something stupid.
The tablet:
SUPERPAD FLYTOUCH
10.2" >24GB< ANDROID 4.0 TABLET A10 1.5Ghz CPU | 1GB RAM
"About this Tablet" says:
Model: BC1003
Android 4.04
Baseband ver 1.5rc4
Kernel 3.0.8 [email protected] #2 Mon Aug 6 15:23:31 CST 2012
There are 2 USB-A ports on this device. One has a physical switch that goes from device to host mode, comes with a male-male cable for attaching to a PC. The other port is host only. I can connect a USB thumb drive and it mounts just fine, shows up in the file manager, no problems. Same for a USB keyboard. It powers any USB device I've plugged into it.
The problem:
It works well enough for most things. But, I've now run into two applications that won't use the host USB port on the thing. Both seem to want to do basic serial communication. At this point, those 2 apps are about the only things I actually want to do with it, so I'm willing to experiment.
I have a USB oscilloscope that comes with an Android app. The app installs and runs fine, but it won't recognize the hardware usb device I've plugged in. Annoying, but I don't really need it. I've recently purchased some digital scales(DROs) for my lathe/mill. There's an Android app that interfaces these scales to an Arduino device via USB. Installs fine, won't connect to the Arduino. Okay, now this is starting to get annoying. Also, for what it's worth, the Android app for doing general Arduino stuff didn't work either.
So, the USB hardware works enough to connect a USB thumb drive or keyboard but the firmware won't use said hardware to do what I want.
The questions:
Am I doing something wrong? Is there an app I can install that enables serial communication over USB host mode? Am I missing something stupid?
Is there any other firmware I can run that will allow this communication? I think I've got the Windows utility that will allow me to flash the rom. I've watched the youtube vids on dis-assembly so I can pull the internal tf/sdcard and make a full dd backup. I'm assuming it contains the roms and everything else. Actually, I'm thinking about just pulling said card and replacing it with a smaller one for experimenting. Will I still be able to flash it using the windows LiveSuite utility even with a blank card inserted?
At this point, I'm willing to play. I mean, it's still useful enough to be careful, but I'm willing to take some chances and put a little work into it. If I can get it running with the DRO software while talking over USB to the Arduino, I'd sacrifice everything else. GPS, battery life, wifi, screen rotation, sound, whatever. I'd just bolt the thing next to the mill and that's that. Failing that, I'll put it back to stock and stick it on the fridge for my wife to look up recipes, Yeah, poor tablet... motor oil and metal swarf or cooking oil and flour. No happy retirement for this tablet, sitting in a drawer gathering dust.
Any hints, links, recommendations, or directions appreciated.
David...

Turn Phone into USB Keyboard without low level kernel modifications.

Hello folks,
I am stuck and I hope you guys can help me out with a tip or two.
What I am trying to do is:
1) Connect my smartphone to a desktop through a USB cable (or OTG cable or anything that will do the job) and make the desktop think that a usb keyboard was connected to it and not a smartphone (hence no need for drivers installation).
2) After usb cable connection, the smartphone will be able to send keystrokes to the desktop.
Points of consideration:
* The desktop has no bluetooth nor wireless connections and nothing can be installed in it.
* installing an app (downloaded from store) into the smartphone is possible, but with no kernel modifications or root, I mean out of the box solution.
From reading those two great links:
[1] https://stackoverflow.com/questions...ogram-android-to-act-as-physical-usb-keyboard
[2] http://forum.xda-developers.com/showthread.php?t=1871281
It appears my best option is to use a USB cable with a "special hardware level converter " and attache it both to the desktop and smartphone. It will tell the desktop it is a USB keyboard and receive keystrokes from the smartphone, before forwarding them to the desktop.
My question is:
Does such cable exist?
If yes, where can I find it?
If not, is there a company that can help make it?
Thanks guys, Mozart

Categories

Resources