USB Accessories Support on Android

In the recent past the Android users have been facing problems accessing the USB port efficiently for configuring their accessories to the Android powered phones or tablets. To solve these problems Android developers announced an all new Android Open Accessory API which permits the Android devices running on Android 3.1 or 2.3.4 to connect to USB accessories easily, without any additional fees or licensing. In the newly developed version the Android device does not act as a host, but instead gives accessories the right to be hosts and perform the corresponding functions.
The main function of the host is to act as a bus master which controls the data input and output channels and decide its use at varied times. The host also acts as the powered bus to provide power. In the computer world the laptop or the desktop acts as the host which performs as the bus master as well as providing power to the bus. While the other accessories such as the mouse, printer, webcam etc. act as the USB devices. Similarly in the smart phones the phone device acts as the host whereas its accessories act as the USB devices. But since very few Android powered devices support host mode to successfully connect the accessories as the USB devices, the Android developers turned the normal relationship on its head. Instead of using the phone or tablets as hosts, they act as USB Devices and the accessories acts as the USB Host. This means that the accessories act as the bus master and a powered bus.
The Open Accessory will consist of a USB host and a system to provide power to the Android Device such as a phone or tablet. Once the accessory is connected to the device the device will identify itself on the basis of its VID/PID (significant IDs which are unique to the Device model and manufacturer). Once the device is detected the accessory asks the device to switch to accessory mode by sending a series of control transactions to the device. While switching to accessory mode the device will reappear with the new VID/PID corresponding to the accessory mode. The above protocol will help the device to start in the accessory mode after the appropriate application is initiated. If the specific application is not found, the protocol will suggest a relevant URL for the application.
How to start Android device in accessory mode?
Step 1: Send a 51 control (“get protocolâ€) request to detect if the device supports Android Accessory Protocol. If the device supports the protocol, a non-zero number is returned. This number represents the version of the protocol. The following are the characteristics of the request control.
Step 2: After the appropriate protocol version is returned by the device, send a string information to the device, this information will select the appropriate application for the accessory attached, if the application is not found in the device it will suggest the user with a URL. The characteristics of this request are as follows:
The following string IDs are supported with maximum size of 256 bytes for each string.
Step 3: Once the application has been chosen, send the request to start device in accessory mode. This request is a control request on endpoint 0 having characteristics as follows:
After the final control request has been sent, the device will reappear in the accessory mode and the accessory will be able to identify the device and establish communication with the device. Thus the Android seems to have created a pathway for configuring the accessories with the devices.
Advertisement
Thanks for the tip Martin.
It is for these kinds of posts that I follow GHacks.
What’s up with the generic comment, are you a bot?
2G?
Where on the planet is that still in use? I was forced to give up using my RAZRV3 years ago because 2G was phased out by AT&T.
Everywhere 3G has been turned off and you don’t have LTE coverage, and believe me there are many developed countries where this is the case and if it weren’t for 2G you wouldn’t even be able to make a phone call.
Maybe I missed it, but I don’t believe tha term “2G” is in the article. Perhaps you are referring to “AGM G2”??
@Martin
Your website has gone insane.
When I the post button I then saw my comment posted on a different article page. When I opened this article again, it is here.
@Tachy @Martin Brinkmann
” Your website has gone insane. ”
Same here. Has happened several times.
@Tachy,
@Martin P.,
For over two weeks now,
I’ve been seeing “Comments” posted by subscribers appearing in different, unrelated articles.
https://www.ghacks.net/windows-11-update-stuck-fixed-for-good/#comment-4572991
https://www.ghacks.net/windows-11-update-stuck-fixed-for-good/#comment-4572951
For the time being,
it would be better to specify the “article name and URL” at the beginning of the post.
@tachy a lot of non-phone devices with a sim in them rely on 2G, at least here in europe.
Usually things reporting usage or errors/alarms on something remote that does not get day to day inspection in person. They are out there in vast numbers doing important work. Reliable, good range. The low datarate is no problem at all in those cases.
3G is gone or on its last legs everywhere, but this stuff still has too much use to cancel.
Anyhow, interesting that they would put that in. I can see the point if you suspect a hostile 2G environment (amateur eavesdroppers with laptop, ranging up to professional grade MITM fake towers while “strangely” not getting the stronger crypto voip 4G because it is being jammed, and back down to something as old ‘stingray’ devices fallen into the wrong hands).
But does this also mean that they have handled and rolled out a fix for that nasty 4G ‘pwn by broadcast’ problem you reported earlier this year? I had 4G disabled due to that, on the off chance that some of the local criminals would buy some cheap chinese gear, download a working exploit and probe every phone in range all over town in the hope of getting into phones of the police.
>”While most may never be attacked in stingrays, it is still recommended to disable 2G cellular connections, especially since it does not have any downsides.”
The downside would be losing connectivity. I spend a lot of time way out in the countryside where there’s often no service or almost none. My network allows 2G, and I need it sometimes. I have an option on the phone to disable 2G, I may do that when I’m in the city and I have good 5G connectivity, but not out in the country.
I would imagine that the stingray exploits, like most of the bad things in this world, are probably things you will run into in the crowded big cities.
I stopped using it in a mobile (Wi-Fi line) environment, so I’m almost ignorant of the actual situation,
But the recent reality in Japan makes me realize that “the infrastructure of the web is nothing more than a papier-mâché fiction”.
https://www.ghacks.net/2023/08/17/google-chrome-to-enable-https-first-by-default-for-all-users/#comment-4572402
It is already beyond the scope of what an individual can do.
What we should be aware of is the reality that “governments and those in power want to control the world through the Web”, and efforts to counter (resist and prevent) such ambitions are necessary.
Why do you want people to disable the privacy features? Hmmmmm?
Now You: do you plan to keep the Ads privacy features enabled?
I’d like to tell you, but apparently if you make a post critical of Google, you get censored. * [Editor: removed, just try to bring your opinion across without attacking anyone]
@Martin
You website is still psychotic. Comments attach to random stories.
@Martin please do fix the comments, it’s completely insane commenting here! :[
@Martin
The comments are seriously messed up on gHacks now. These comments are mixed with the article at the below URL.
https://www.ghacks.net/2023/08/18/android-how-to-disable-2g-cellular-connections-to-improve-security/
And comments on other articles are from as far back as 2010.
What does this article has anything to do with all the comments on this article? LOL I think this Websuite is ran by ChatGPT. every article is messed up. Some older comments from 2015 shown up in recant articles, LOL
The picture captioned “Clearing the Android Auto’s cache might resolve the issue” is from Apple Carplay ;)
How about other things that matter:
Drop survival?
Screen toughness?
Degree of water and dust protection?