Android's instructions for <uses-feature>

Source: Internet
Author: User

<uses-feature> is mostly used by play. Example:

<uses-featureandroid:name="Android.hardware.touchscreen"  android:required = "true" />
If the device does not have this touchscreen hardware, Play will not install the app on this device. False will still be installed.


Android Apps can declare hardware feature requirements in the app manifest to ensure that they does not get Installe D on devices This does not provide those features. If you is extending an existing app for use on TV, closely review your app ' s manifest for any hardware requirement Declar Ations that might prevent it from being installed on a TV device.

Some features has subfeatures like Android.hardware.camera.front, as described in the Feature Reference. Be sure to mark as required= "false" any subfeatures also used in your app.

For example, my app will use the camera, but it's not necessary. For this I announced the camera's <uses-permission>, but omitted <uses-feature>.

<uses-permissionandroid:name="android.permission. CAMERA  "  />

this time Google Play discovered this <uses-permission>, and will be the camera as necessary to go through the discard, without the camera device will not see my app, which is different from the results I want. Setting to False will not be the problem anymore!


In addition, the app can also determine whether to support this hardware

Check If the camera hardware feature is Available.if (Getpackagemanager (). Hassystemfeature ("Android.hardware.camera" ) {    log.d ("Camera Test", "Camera available!"),} else {    log.d ("Camera Test", "No camera available"). View and edit features only. ");}






Android's instructions for <uses-feature>

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.