USB for Android phones

Source: Internet
Author: User

USB for Android phones
Android phones seldom use the USB Host function, but many tablets do. In fact, the android USB Host function is relatively simple, the driver is the Program that drives the USB controller and port. We mainly discuss the USB slave function, which is not available on every USB phone.
How do we use USB? There are basically the following functions.
1. Charge
2. connect to your computer and use it as a large hard drive.
3. connect to your computer, MTP or PTP
4. Connect to the computer and support ADB commands
5. Connect to the computer and support the protocols of various vendors, for example, Samsung Kies Huawei's hsuite LG's LG kit
6. Connect to the computer to implement the USB Nic function, which is also called USB bundle

In fact, Android OS is based on Linux. Therefore, Android USB support is Linux USB support. To understand the USB support of Android, you must understand the concept of a gadget. The Linux-USB Gadget driver framework provides software functions for devices defined by the USB protocol.

A USB device controller is mounted to a USB _ gadget_driver, and usb_composite_dev is mounted to the UDC gadget. usb_composite_driver is mounted to usb_composite_dev, and a USB _ configuration is mounted to usb_composite_dev, then, a function is mounted to the function linked list of usb_configuration, and the function is written to the interface array of the corresponding config. This is the entire process.

Therefore, USB implements different functions by establishing different functions of the system and then providing corresponding data according to the protocol.

In Android, there is an important prop setting. persist. SYS. USB. config we can use this configuration to support different functions.

For example, ADB shell setprop persist. SYS. USB. config MTP, ADB, ACM

MTP supports media Transfer Protocol (MTP)

ACM supports the USB analog serial port function. It is a standard device defined by Microsoft and can be driven without installing a host driver.

ADB is the debugging Bridge of Google, and the host needs the corresponding driver.

....

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.