send serial data over USB from my motorola defy+ - General Topics

Hi xda dev team !
I would like to write an android app which sends serial data (over USB as bridge) to a hobby
circuit. The app should work on my Motorola Defy+ (android 2.3.6) and look like
a text editor (with some exceptions) - the window content should be sent to my circuit.
The problem is that the only programming language I know is C and my Linux knowledge
is minimal, almost zero ! FTDI offers some "java drivers" on their site for USB to serial converter
chipsets, but those work only on android 3.1 and above (USB host capability on android device).
An alternative would be the use chipsets like FT 311/312 which act as usb hosts
and comunicate over AOA (Android Open Accessory) Protocols with android devices.
How do i know which AOA protocol version my phone has (i want to make my app upwards compatible
so it can be used by as much android devices as possible)? Also, which IDE should i use
taking into account that i'm a beginner in this matter ? Can somebody give me some tips
where to start from ?
thanks!

Related

[REQ][APP] Bluetooth communication

hello everyone,
Can anyone make an application which sends ASCII code via bluetooth to a PC or a bluetooth module??
I really need it for my mechatronics project.
Thanks before
Does it have to be Bluetooth? You might be able to cobble something together over USB with the USB host driver.
I'd like wireless communication for the system since cable is kinda out of date...
But when time is running out... I guess USB will be OK. But for now, since I still have plenty of time, I'd go with wireless.
You could use the chroot method and install Ubuntu on your Nexus One. I don't know if it exposes the phone's Bluetooth interface, but it might be worth looking at since you could code up anything you want in any language if that were the case.
ermmm... it's kinda advance...
any URL to the guide maybe???
is there no ordinary apps or so?
Basic serial over bluetooth is done using the RFCOMM profile, details on how to write an app can be found here:
http://developer.android.com/guide/topics/wireless/bluetooth.html
I'd guess you open a socket to the destination machine, just like normal network programming, just over bluetooth rather than tcp. Here is a stackoverflow article on the subject
http://stackoverflow.com/questions/...-sdp-connection-to-a-rs232-adapter-in-android
....
I'll try my best to understad it
complete noob on java programing here T^T

[Q] is /dev/bus/usb/* Standard in Android

I have an ePad (Android 2.1) that mounts usb devices in the normal Linux way so that I can use libusb to access them, I have managed to control my usb robot arm using an NDK app. Before I move onto making it a proper app instead of a hack job I wanted to know if the usb device files are standard to Android or if it's specific to my system.
Put it this way, if I make a nice cuddly app is it going to fail on most devices or work on most devices? (ones with USB OTG interface)
Sorry, I understand this could be a 'how long is a piece of string' type of question.
Many thanks,
Richard e Collins.
After a few hours of routing about on the internet I found an article on an exploit on the init daemon, google "android-root-source-code-looking-at-the-c-skills". This gave enough insight for me to deduce that this functionality I am getting is present on at least anything running 2.1 and above and is not a customisation unique to my device.

[Q] developing app to use USB webcam

Hello *,
a customer asked me to develop an app for Android tablets that should use an external USB webcam (UVC). The app should target any consumer tablet that has a USB Host interface and MUST NOT require rooting.
According to API level 12 docs or Android 3.1, it is possible to use any external USB device.
Until here is theory. Is it actually possible, in practice, and how hard can it be to write java code that implements a UVC driver in user space? The UVC standard documents are hundreds pages long and I fail to understand how much of that specs need to be implemented on the host side, and how much is eventually already implemented in the Android Linux kernels.

USB host capabilities.

After searching and not finding what I was looking for, I always go to XDA. What android phones from Verizon have usb hosting capabilities. Specifically I want to connect and external hard drive to transfer files. I know you're probably wondering why I just don't use a computer, well my 4 year old son made my computer unusable. Thanks in advance for any help.
Sent from my DINC2
Just look at the market
Search: "usb host"
First result is okay
The problem is:
- Your hardware need to support it
- You need to be root.
But you can try!
---------------------------------
Fernando Setien
I've tried the usb host controllers app, but that was a no go. I have an incredible 2 that is rooted. I should have included this in my first post, but I failed to.
Sent from my DINC2
Also the kernel needs to support it and no stock kernel does that I know of.
Supposedly, Android 3.1 and newer support USB host mode. In some cases you'll need special adapters and/or a powered USB hub. Unfortunately, I'm too new of a user to post outside links (the forum won't let me), but there's much documentation on the Android developer site regarding host mode v. accessory mode, and at least one article/forum thread showing an Android 3.1 tablet with an Android 2.2 phone plugged into it, the tablet reading the phone's logs over the USB connection.
In other words, it's possible, but hardware limitations may make it difficult, as will whatever version of Android you're using.
YellowApple said:
Supposedly, Android 3.1 and newer support USB host mode. In some cases you'll need special adapters and/or a powered USB hub. Unfortunately, I'm too new of a user to post outside links (the forum won't let me), but there's much documentation on the Android developer site regarding host mode v. accessory mode, and at least one article/forum thread showing an Android 3.1 tablet with an Android 2.2 phone plugged into it, the tablet reading the phone's logs over the USB connection.
In other words, it's possible, but hardware limitations may make it difficult, as will whatever version of Android you're using.
Click to expand...
Click to collapse
I am running a ICS and it is not enabled by default. It maybe on Tablets but not mobile phones. A search will lead you to threads about it asking for it to be add to the kernel but you remove options when you do and there has not been alot of want for it.
Native support
At least Samsung Galaxy SII and Note does usb Host with the default ROM. You can see with cable you need (witch could be an issue too) on many blogs.

Accessing USB devices without root from Android NDK code

First up, I tried to post this in "Android Software Development" but unfortunately don't have the minimum 10 posts required to do so and didn't really feel like spamming the forums to make the count. If a moderator could move this post for me it would be greatly appreciated.
On an Android 4.0+ device (ie, contains the USB Host APIs), you can write applications that interface with USB devices that don't require root. Unfortunately I'm working with a codebase that is in C using libusb and while I've gotten a prototype working in a terminal emulator, at this stage it seems to require root to actually talk to the devices (enumerating devices seems ok though).
I had a look at the Android NDK API list but didn't see any reference to USB Host APIs leading me to believe that the only ones that exist are the underlying Linux APIs. Is there a way (without bouncing all calls to the USB Host APIs through JNI, or rewriting the entire thing in Java) to access USB devices when in USB OTG mode without root from Android NDK code?

Categories

Resources