Android USB API gets device information failure issue

Source: Internet
Author: User

In Huawei Glory Box Verification Openni program, found Orbbec 3d camera has been unable to use, has been stuck in the device can not find the prompt. Start from the following 2 aspects of verification: 1. Verify that the Openni itself comes with the Simpleread program to see if it reads normally to the device information and depth diagram. 2. Verify the android Layer USB permissions control issue.

After verifying that Openni's own executable program of C + + is found, it can read the device information and depth diagram normally. It is speculated that the drive of Orbbec 3d and this part of Openni is not a problem. The problem may be the USB permissions on the Android layer and get the device information for this piece.

Usbmanager usbmanager= (Usbmanager) Getsystemservice (Context.usb_service); HashMap list=usbmanager.getdevicelist (); LOG.V ("Xcy", "List Size" +list.size ());

Verified to find that Devicelist has been returned empty through Usbmanager. Find the following solution by searching.

USB device information can not be obtained with usbmanager.getdevicelist, the following processing is required to obtain the USB device information

To enable USB host API should add a file named
Android.hardware.usb.host.xmland containing the following lines:

<permissions> <feature name= "Android.hardware.usb.host"/></permissions>

Into folder

/system/etc/permissions

In that folder find file named

Handheld_core_hardware.xml or Tablet_core_hardware.xml

and add

<feature name= "Android.hardware.usb.host"/>

After you modify the file, push to the system, and then restart the device. You can use it.



Android USB API gets device information failure issue

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.