Permissions is designed to maintain the security between application and application user. Using the permissions we can give the privilege to android app to access any specific feature of that application. Android has its unique file structure for application development so Android gives us a file named as AndroidManifest.xml. The AndroidManifest.xml file contain all the important information about application like Application Icon details, Application name and all about activities. AndroidManifest.xml file is used to set normal permissions inside it. So in this tutorial we would going to learn about Add Permissions for Android in AndroidManifest.xml in React Native App. I would also provide the List of all available permissions for android below. Have Fun .
Contents in this project Add Permissions for Android in AndroidManifest.xml in React Native App :
1. To add any permission in AndroidManifest.xml file first we have to open it. The AndroidManifest.xml is located inside YourReactNativeAppProject -> android -> app -> src -> main -> AndroidManifest.xml.
2. Open your file in Any text editor. I am opening this file in Notepad++ . Below is the code of my project’s AndroidManifest.xml.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<manifest xmlns:android=“http://schemas.android.com/apk/res/android”
package=“com.mynewproject”
android:versionCode=“1”
android:versionName=“1.0”>
<uses–permission android:name=“android.permission.INTERNET” />
<uses–permission android:name=“android.permission.SYSTEM_ALERT_WINDOW”/>
<uses–sdk
android:minSdkVersion=“16”
android:targetSdkVersion=“22” />
<application
android:name=“.MainApplication”
android:allowBackup=“true”
android:label=“@string/app_name”
android:icon=“@mipmap/ic_launcher”
android:theme=“@style/AppTheme”>
<activity
android:name=“.MainActivity”
android:label=“@string/app_name”
android:configChanges=“keyboard|keyboardHidden|orientation|screenSize”
android:windowSoftInputMode=“adjustResize”>
<intent–filter>
<action android:name=“android.intent.action.MAIN” />
<category android:name=“android.intent.category.LAUNCHER” />
</intent–filter>
</activity>
<activity android:name=“com.facebook.react.devsupport.DevSettingsActivity” />
</application>
</manifest>
|
3. Now you can see there are already 2 permissions added in this file named as INTERNET and SYSTEM_ALERT_WINDOW. These permissions is already come inbuilt with React Native project. To add any permission in this file simply press enter and add your permission below of these two permissions like i did in below code. I am only adding CAMERA permission.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<manifest xmlns:android=“http://schemas.android.com/apk/res/android”
package=“com.mynewproject”
android:versionCode=“1”
android:versionName=“1.0”>
<uses–permission android:name=“android.permission.INTERNET” />
<uses–permission android:name=“android.permission.SYSTEM_ALERT_WINDOW”/>
<uses–permission android:name=“android.permission.CAMERA”/>
<uses–sdk
android:minSdkVersion=“16”
android:targetSdkVersion=“22” />
<application
android:name=“.MainApplication”
android:allowBackup=“true”
android:label=“@string/app_name”
android:icon=“@mipmap/ic_launcher”
android:theme=“@style/AppTheme”>
<activity
android:name=“.MainActivity”
android:label=“@string/app_name”
android:configChanges=“keyboard|keyboardHidden|orientation|screenSize”
android:windowSoftInputMode=“adjustResize”>
<intent–filter>
<action android:name=“android.intent.action.MAIN” />
<category android:name=“android.intent.category.LAUNCHER” />
</intent–filter>
</activity>
<activity android:name=“com.facebook.react.devsupport.DevSettingsActivity” />
</application>
</manifest>
|
List of All Normal and Dangerous Permissions in Android :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
<uses–permission android:name=“android.permission.ACCESS_COARSE_LOCATION”/>
<uses–permission android:name=“android.permission.ACCESS_FINE_LOCATION”/>
<uses–permission android:name=“android.permission.ACCESS_LOCATION_EXTRA_COMMANDS”/>
<uses–permission android:name=“android.permission.ACCESS_MOCK_LOCATION”/>
<uses–permission android:name=“android.permission.ACCESS_CHECKIN_PROPERTIES”/>
<uses–permission android:name=“android.permission.ACCESS_NETWORK_STATE”/>
<uses–permission android:name=“android.permission.ACCESS_NOTIFICATION_POLICY”/>
<uses–permission android:name=“android.permission.ACCESS_SURFACE_FLINGER”/>
<uses–permission android:name=“android.permission.ACCESS_WIFI_STATE”/>
<uses–permission android:name=“android.permission.ACCOUNT_MANAGER”/>
<uses–permission android:name=“android.permission.ADD_VOICEMAIL”/>
<uses–permission android:name=“android.permission.ANSWER_PHONE_CALLS”/>
<uses–permission android:name=“android.permission.AUTHENTICATE_ACCOUNTS”/>
<uses–permission android:name=“android.permission.BATTERY_STATS”/>
<uses–permission android:name=“android.permission.BIND_ACCESSIBILITY_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_APPWIDGET”/>
<uses–permission android:name=“android.permission.BIND_AUTOFILL_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_CARRIER_MESSAGING_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_CARRIER_SERVICES”/>
<uses–permission android:name=“android.permission.BIND_CHOOSER_TARGET_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_CONDITION_PROVIDER_SERVICE.”/>
<uses–permission android:name=“android.permission.BIND_DEVICE_ADMIN”/>
<uses–permission android:name=“android.permission.BIND_DREAM_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_INCALL_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_INPUT_METHOD”/>
<uses–permission android:name=“android.permission.BIND_NFC_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_MIDI_DEVICE_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_NOTIFICATION_LISTENER_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_PRINT_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_QUICK_SETTINGS_TILE”/>
<uses–permission android:name=“android.permission.BIND_REMOTEVIEWS”/>
<uses–permission android:name=“android.permission.BIND_SCREENING_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_TELECOM_CONNECTION_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_TEXT_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_TV_INPUT”/>
<uses–permission android:name=“android.permission.BIND_VISUAL_VOICEMAIL_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_VOICE_INTERACTION”/>
<uses–permission android:name=“android.permission.BLUETOOTH”/>
<uses–permission android:name=“android.permission.BIND_WALLPAPER”/>
<uses–permission android:name=“android.permission.BLUETOOTH_PRIVILEGED”/>
<uses–permission android:name=“android.permission.BLUETOOTH_ADMIN”/>
<uses–permission android:name=“android.permission.BIND_VR_LISTENER_SERVICE”/>
<uses–permission android:name=“android.permission.BIND_VPN_SERVICE”/>
<uses–permission android:name=“android.permission.BODY_SENSORS”/>
<uses–permission android:name=“android.permission.BRICK”/>
<uses–permission android:name=“android.permission.BROADCAST_PACKAGE_REMOVED”/>
<uses–permission android:name=“android.permission.BROADCAST_SMS”/>
<uses–permission android:name=“android.permission.BROADCAST_STICKY”/>
<uses–permission android:name=“android.permission.BROADCAST_WAP_PUSH”/>
<uses–permission android:name=“android.permission.CALL_PHONE”/>
<uses–permission android:name=“android.permission.CAMERA”/>
<uses–permission android:name=“android.permission.CALL_PRIVILEGED”/>
<uses–permission android:name=“android.permission.CAPTURE_AUDIO_OUTPUT”/>
<uses–permission android:name=“android.permission.CAPTURE_SECURE_VIDEO_OUTPUT”/>
<uses–permission android:name=“android.permission.CAPTURE_VIDEO_OUTPUT”/>
<uses–permission android:name=“android.permission.CHANGE_COMPONENT_ENABLED_STATE”/>
<uses–permission android:name=“android.permission.CHANGE_CONFIGURATION”/>
<uses–permission android:name=“android.permission.CHANGE_NETWORK_STATE”/>
<uses–permission android:name=“android.permission.CHANGE_WIFI_MULTICAST_STATE”/>
<uses–permission android:name=“android.permission.CHANGE_WIFI_STATE”/>
<uses–permission android:name=“android.permission.CLEAR_APP_CACHE”/>
<uses–permission android:name=“android.permission.CLEAR_APP_USER_DATA”/>
<uses–permission android:name=“android.permission.CONTROL_LOCATION_UPDATES”/>
<uses–permission android:name=“android.permission.DELETE_CACHE_FILES”/>
<uses–permission android:name=“android.permission.DELETE_PACKAGES”/>
<uses–permission android:name=“android.permission.DEVICE_POWER”/>
<uses–permission android:name=“android.permission.DIAGNOSTIC”/>
<uses–permission android:name=“android.permission.DISABLE_KEYGUARD”/>
<uses–permission android:name=“android.permission.DUMP”/>
<uses–permission android:name=“android.permission.EXPAND_STATUS_BAR”/>
<uses–permission android:name=“android.permission.FACTORY_TEST”/>
<uses–permission android:name=“android.permission.FLASHLIGHT”/>
<uses–permission android:name=“android.permission.FORCE_BACK”/>
<uses–permission android:name=“android.permission.GET_ACCOUNTS”/>
<uses–permission android:name=“android.permission.GET_ACCOUNTS_PRIVILEGED”/>
<uses–permission android:name=“android.permission.GET_PACKAGE_SIZE”/>
<uses–permission android:name=“android.permission.GET_TASKS”/>
<uses–permission android:name=“android.permission.GET_TOP_ACTIVITY_INFO”/>
<uses–permission android:name=“android.permission.GLOBAL_SEARCH”/>
<uses–permission android:name=“android.permission.HARDWARE_TEST”/>
<uses–permission android:name=“android.permission.INJECT_EVENTS”/>
<uses–permission android:name=“android.permission.INSTALL_LOCATION_PROVIDER”/>
<uses–permission android:name=“android.permission.INSTALL_PACKAGES”/>
<uses–permission android:name=“android.permission.INSTALL_SHORTCUT”/>
<uses–permission android:name=“android.permission.INSTANT_APP_FOREGROUND_SERVICE”/>
<uses–permission android:name=“android.permission.INTERNAL_SYSTEM_WINDOW”/>
<uses–permission android:name=“android.permission.INTERNET”/>
<uses–permission android:name=“android.permission.KILL_BACKGROUND_PROCESSES”/>
<uses–permission android:name=“android.permission.LOCATION_HARDWARE”/>
<uses–permission android:name=“android.permission.MANAGE_ACCOUNTS”/>
<uses–permission android:name=“android.permission.MANAGE_APP_TOKENS”/>
<uses–permission android:name=“android.permission.MANAGE_DOCUMENTS”/>
<uses–permission android:name=“android.permission.MANAGE_OWN_CALLS”/>
<uses–permission android:name=“android.permission.MASTER_CLEAR”/>
<uses–permission android:name=“android.permission.MEDIA_CONTENT_CONTROL”/>
<uses–permission android:name=“android.permission.MODIFY_AUDIO_SETTINGS”/>
<uses–permission android:name=“android.permission.MOUNT_FORMAT_FILESYSTEMS”/>
<uses–permission android:name=“android.permission.MODIFY_PHONE_STATE”/>
<uses–permission android:name=“android.permission.MOUNT_UNMOUNT_FILESYSTEMS”/>
<uses–permission android:name=“android.permission.NFC”/>
<uses–permission android:name=“android.permission.PACKAGE_USAGE_STATS”/>
<uses–permission android:name=“android.permission.PERSISTENT_ACTIVITY”/>
<uses–permission android:name=“android.permission.PROCESS_OUTGOING_CALLS”/>
<uses–permission android:name=“android.permission.READ_CALENDAR”/>
<uses–permission android:name=“android.permission.READ_CALL_LOG”/>
<uses–permission android:name=“android.permission.READ_CONTACTS”/>
<uses–permission android:name=“android.permission.READ_EXTERNAL_STORAGE”/>
<uses–permission android:name=“android.permission.READ_FRAME_BUFFER”/>
<uses–permission android:name=“android.permission.READ_HISTORY_BOOKMARKS”/>
<uses–permission android:name=“android.permission.READ_INPUT_STATE”/>
<uses–permission android:name=“android.permission.READ_LOGS”/>
<uses–permission android:name=“android.permission.READ_PHONE_NUMBERS”/>
<uses–permission android:name=“android.permission.READ_PHONE_STATE”/>
<uses–permission android:name=“android.permission.READ_PROFILE”/>
<uses–permission android:name=“android.permission.READ_SMS”/>
<uses–permission android:name=“android.permission.READ_SOCIAL_STREAM”/>
<uses–permission android:name=“android.permission.READ_CALL_LOG”/>
<uses–permission android:name=“android.permission.READ_SYNC_SETTINGS”/>
<uses–permission android:name=“android.permission.READ_USER_DICTIONARY”/>
<uses–permission android:name=“android.permission.READ_VOICEMAIL”/>
<uses–permission android:name=“android.permission.PROCESS_OUTGOING_CALLS”/>
<uses–permission android:name=“android.permission.REBOOT”/>
<uses–permission android:name=“android.permission.SEND_RESPOND_VIA_MESSAGE”/>
<uses–permission android:name=“android.permission.SEND_SMS”/>
<uses–permission android:name=“android.permission.SET_ACTIVITY_WATCHER”/>
<uses–permission android:name=“android.permission.SET_ALARM”/>
<uses–permission android:name=“android.permission.SET_ALWAYS_FINISH”/>
<uses–permission android:name=“android.permission.SET_ANIMATION_SCALE”/>
<uses–permission android:name=“android.permission.SET_DEBUG_APP”/>
<uses–permission android:name=“android.permission.SET_ORIENTATION”/>
<uses–permission android:name=“android.permission.SET_POINTER_SPEED”/>
<uses–permission android:name=“android.permission.SET_PREFERRED_APPLICATIONS”/>
<uses–permission android:name=“android.permission.SET_PROCESS_LIMIT”/>
<uses–permission android:name=“android.permission.SET_TIME”/>
<uses–permission android:name=“android.permission.SET_TIME_ZONE”/>
<uses–permission android:name=“android.permission.SET_WALLPAPER”/>
<uses–permission android:name=“android.permission.SET_WALLPAPER_HINTS”/>
<uses–permission android:name=“android.permission.TRANSMIT_IR”/>
<uses–permission android:name=“android.permission.UNINSTALL_SHORTCUT”/>
<uses–permission android:name=“android.permission.UPDATE_DEVICE_STATS”/>
<uses–permission android:name=“android.permission.USE_CREDENTIALS”/>
<uses–permission android:name=“android.permission.USE_FINGERPRINT”/>
<uses–permission android:name=“android.permission.USE_SIP”/>
<uses–permission android:name=“android.permission.VIBRATE”/>
<uses–permission android:name=“android.permission.WAKE_LOCK”/>
<uses–permission android:name=“android.permission.WRITE_APN_SETTINGS”/>
<uses–permission android:name=“android.permission.WRITE_CALENDAR”/>
<uses–permission android:name=“android.permission.WRITE_CALL_LOG”/>
<uses–permission android:name=“android.permission.WRITE_CONTACTS”/>
<uses–permission android:name=“android.permission.WRITE_EXTERNAL_STORAGE”/>
<uses–permission android:name=“android.permission.WRITE_GSERVICES”/>
<uses–permission android:name=“android.permission.WRITE_HISTORY_BOOKMARKS”/>
<uses–permission android:name=“android.permission.WRITE_PROFILE”/>
<uses–permission android:name=“android.permission.WRITE_SECURE_SETTINGS”/>
<uses–permission android:name=“android.permission.WRITE_SETTINGS”/>
<uses–permission android:name=“android.permission.WRITE_SMS”/>
<uses–permission android:name=“android.permission.WRITE_SOCIAL_STREAM”/>
<uses–permission android:name=“android.permission.WRITE_SYNC_SETTINGS”/>
<uses–permission android:name=“android.permission.WRITE_USER_DICTIONARY”/>
<uses–permission android:name=“android.permission.WRITE_VOICEMAIL”/>
|