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/