Search code examples
androidandroid-manifestandroid-library

What is the difference between <uses-feature> and <uses-library>?


I've gone through the android documentation to understand about what and mean by,

< uses-library>

< uses-feature>

But it's unclear finally what exactly is the difference between both. Though it's a library it can be described as a feature as well. What's the use of both and when to use which one if we are creating a library or feature?


Solution

  • This is from App Manifest Overview :

    uses-feature:

    The element allows you to declare hardware and software features your app needs. For example, if your app cannot achieve basic functionality on a device without a compass sensor, you can declare the compass sensor as required with the following manifest tag: ...

    <manifest ... >
    <uses-feature android:name="android.hardware.sensor.compass"
                  android:required="true" />
    ...</manifest>
    

    uses-library:

    Specifies a shared library that the application must be linked against.