I noticed that there are two types of permissions in the manifest file, "permission" and "uses-permission" like the two shown below;
<permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
for the following 4 permissions which do I use when I put them in my manifest.xml file? uses-permissions
or permissions
?
android.permission.ACCESS_NETWORK_STATE
android.permission.ACCESS_WIFI_STATE
android.permission.INTERNET
android.permission.CHANGE_WIFI_MULTICAST_STATE
In short, the one you needed is the uses-permission statement.
Androird Document now has a dedicated page discussing these two usages.
In the Using Permissions part, it explains that
is used to declare what permissions you'd like to use.
While in Defining and Enforcing Permissions you can see that
is used to define your own permission.
For
The documentation states:
Therefore, since you are accessing Android's permissions, you want
uses-permission
instead. The documentation for this element states:<permission>
is normally used when making a custom permission (e.g. when making an app that other apps can tie in to, limiting access is a must), and<uses-permission>
is used when your app actually needs a permission it doesn't have normally.Lets start with "uses-permission...": Suppose you want to use GoogleMap in your application as an example to find a nearest location of any office such as bank or any other office. You need internet. So you need to give the permission to your android device to access INTERNET. This is done by using android permission called .
Now come to "permission..": what it does is it Declares a security permission that can be used to limit access to specific components or features of this or other applications.If your application need some resources or some feature from other application, you can use by giving the specific class or package.
Thanks. for more information, you can read
http://developer.android.com/guide/topics/manifest/manifest-intro.html
In layman terms,
<uses-permission>
specifies permissions your app needs to access some component restrict by another app that is the owner of that component.<permission>
specifies the restrictions you are placing on your components are the component owner.