Why Android 3.1-USB, MTP, and RTP

Source: Internet
Author: User

3.1Three additional packages: Android. Hardware. USB, Android. MTP, and android.net. RTP!

USB, MTP, RTP------- There are three words, all bloody, so people are excited and excited. Why don't you get started with Google?

 

 

Android. MTP

Allow connected camera and other devices to directly use PTP (image transfer protocol) MTP (Media transfer protocol ).

Keep the device connected. The upper-layer app can receive notifications, cancel, manage the files and storage of these devices, transfer files and metadata, and so on.

It provides mtpconstants that define PTP and MTP, describe the mtpdevice of the PTP or MTP device connected to the USB host bus, and encapsulate the mtpdeviceinfo of the MTP device information, and mtpobjectinfo of the object information. mtpstorageinfo is the encapsulation of the storage unit information on the MTP device.

 

Android. Hardware. USB

Supports data communication between peripherals connected to Android power supply devices through USB. The central category is USB Manager, which provides communication methods for identifying and using USB devices and USB accessories. The application can obtain a USB Manager instance and query, manage, and communicate the list of connected devices or accessories.

If the power supply device of Android is used as the USB host, USB device is used. If the peripheral acts as a USB host, use USB accessory. Most input devices, such as the mouse and game lever, camera, and hub, belong to the former, that is, USB device.

<Uses-feature Android: Name = "android. Hardware. USB. Host" Android: required = "true"> </P> <p>
The latter usually uses USB devices as the main controller to provide power and communicate with Android devices, that is, USB accessory.

<Uses-feature Android: Name = "android. Hardware. USB. Accessory" Android: required = "true"> </P> <p>

 

In addition, in order to process the mouse, scroll wheel, and trackball input, two new motion event actions are added:

1. action_scroll, which describes a non-Touch scroll of the pointer position, such as moving from the mouse, scroll wheel, and happen. In motionevent, specify the relative scroll motion for the axis_hscroll and axis_vscroll axis values.
2. action_hover_move: the current position where the mouse button is not pressed, and any center point from the last hover_move event.

Android.net. RTP

Built-in RTP (real-time transmission protocol) protocol stack, which can be used by applications to manage interactive data streams. Applications provide VoIP, one-click access, conferencing, and audio streams. These APIs can be used to start sessions, transmit, or receive data when the Network is available.
The simplest use is a single remote terminal and a local device. Audiostream specifies the remote terminal and network ing and audiocodec configuration.
Audiogroup represents one or more audiostreams local endpoints. Mix all audiogroup audiostreams and choose to interact with the device speaker and microphone at the same time. For more complex applications, the restrictions of the RTP protocol must be taken into account.

To use the rtp api, the application must add this permission.

<Uses-Permission Android: Name = "android. Permission. Internet"> </P> <p>

Obtain the microphone:

<Uses-Permission Android: Name = "android. Permission. record_audio"> <br/>

Author: yiyaaixuexi published on 2:50:00 Original article link reading: 721 comments: 5 Views comments

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.