USB, MTP, RTP for Android 3.1

Source: Internet
Author: User

3.1 More than three big packs of Android.hardware.usb, ANDROID.MTP, ANDROID.NET.RTP!

Android.mtp

Allow connected camera and other devices to directly use the PTP (Image Transfer Protocol) MTP (Media Transfer Protocol).

Keep the device connected, the top app can receive notifications, cancel, manage the files and storage of these devices, file transmission and metadata, etc.

It provides us with the definition of PTP and MTP Mtpconstants, describes the mtpdevice of the PTP or MTP devices connected on the USB host bus, the MTP for encapsulating Mtpdeviceinfo device information, and the mtpobjectinfo of the object's information , the encapsulation mtpstorageinfo for storing cell information on the MTP device.

Android.hardware.usb

Data communication is supported for peripherals connected to the Android power device via USB. The central class is Usbmanager, which provides communication methods for identifying and using USB devices and USB accessories. The application can get a Usbmanager instance and then use it to connect the device or accessory list query, manage, and communicate.

If the Android power supply is a USB host, use Usbdevice. If the peripheral acts as a USB host, use Usbaccessory. Most of the input device mouse and joystick, camera, hubs, etc. belong to the former, namely Usbdevice.

<uses-feature android:name= "Android.hardware.usb.host" android:required= "true" >

The latter, usually USB devices as the main controller, providing power, communication with the Android device, that is, usbaccessory.

<uses-feature android:name= "Android.hardware.usb.accessory" android:required= "true" >

In addition, to handle the mouse, wheel and trackball input, add two new motion event actions:

1.action_scroll, which describes the position of the pointer in a non touch scrolling such as moving from the mouse, the wheel, has occurred. In Motionevent, the relative scrolling motion is specified for the axis_hscroll and Axis_vscroll axis values.

2.action_hover_move, reports the current position of the mouse button without being pressed, and any intermediate points from the last Hover_move event.

Android.net.rtp

Built-in RTP (Real-time Transfer Protocol) protocol stack that applications can use to manage interactive data streams. Applications provide VoIP, one-click, conferencing, and audio streams that can be used to initiate sessions and transmit, or receive data, on the basis of the availability of the network.

The simplest usage is a single remote terminal and local. AUDIOSTREAM specifies the remote terminal and network mapping and configuration Audiocodec composition.

The audiogroup represents one or more audiostreams local endpoints. Mix all the Audiogroup audiostreams and have the option to interact with the device speakers and microphone at the same time. For more complex applications, also take into account the limitations of the RTP protocol itself.

To use the RTP API, the application must add this permission

<uses-permission android:name= "Android.permission.INTERNET" >

Get Microphone:

<uses-permission android:name= "Android.permission.RECORD_AUDIO" >

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/

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.