Android use Permissions
In android we have to set permissions in the project manifest file to get the required android resource. In a basic android application there are no permissions associated with it by default,so it cannot affect the other user experience or any other data.
For example, an application that needs to monitor incoming SMS messages would specify:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.app.myapp" >
<uses-permission android:name="android.permission.RECEIVE_SMS" />
...
</manifest>
Syntax for uses-permission :
<uses-permission android:name="string"
android:maxSdkVersion="integer" />
Attributes:
android:name - to specify the name of the permission used
android:maxSdkVersion-to give the highest API level at which this permission should be granted to your app
Examples of android uses-perrmission
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
0 Comment(s)