You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
[[ AndroidPermissionsLCB ]] Added permission checking handlers to android-utils.
The android-utils lcb module has been updated to expose
LiveCode's android permission API. Three new handlers have been
added to the module that just wrap their equivalent engine
functions.
private foreign handler MCAndroidCheckRuntimePermission(in pPermission as String) \
94
+
returns CBool binds to "<builtin>"
95
+
96
+
/**
97
+
Summary:
98
+
Displays a dialog showing a permission request for <pPermission>. If a user
99
+
has already granted permission for <pPermission>, this function does nothing.
100
+
101
+
Returns true if permission <pPermission> has been granted by the user.
102
+
103
+
Parameters:
104
+
pPermission (enum):
105
+
The name of the permission to request.
106
+
107
+
- "android.permission.READ_CALENDAR": permission to allow an application to read the device's calendar.
108
+
- "android.permission.WRITE_CALENDAR": permission to allow an application to write to the device's calendar.
109
+
- "android.permission.CAMERA": permission to allow an application to access the device's camera.
110
+
- "android.permission.ACCESS_COARSE_LOCATION": permission to allow an application to access the device's coarse location.
111
+
- "android.permission.ACCESS_FINE_LOCATION": permission to allow an application to access the device's fine location.
112
+
- "android.permission.READ_CONTACTS": permission to allow an application to read data from the device's contacts.
113
+
- "android.permission.WRITE_CONTACTS": permission to allow an application to write date to the device's contacts.
114
+
- "android.permission.GET_ACCOUNTS": permission to allow an application to access to the list of accounts in the Accounts Service.
115
+
- "android.permission.RECORD_AUDIO": permission to allow an application to allow an application to record audio.
116
+
- "android.permission.READ_EXTERNAL_STORAGE": permission to allow an application to read data from the device's external storage.
117
+
- "android.permission.WRITE_EXTERNAL_STORAGE": permission to allow an application to write data to the device's external storage.
118
+
- "android.permission.READ_PHONE_STATE": permission to allow an application to access phone state, including the phone number of the device, current cellular network information, the status of any ongoing calls, and a list of any PhoneAccounts registered on the device.
119
+
- "android.permission.READ_PHONE_NUMBERS": permission to allow an application to access the device's phone number(s).
120
+
- "android.permission.CALL_PHONE": permission to allow an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call.
121
+
- "android.permission.ANSWER_PHONE_CALLS": permission to allow an application to answer an incoming phone call.
122
+
- "android.permission.READ_CALL_LOG": permission to allow an application to read the user's call log.
123
+
- "android.permission.WRITE_CALL_LOG": permission to allow an application to write to the user's call log.
124
+
- "android.permission.ADD_VOICEMAIL": permission to allow an application to add voicemails into the system.
125
+
- "android.permission.USE_SIP": permission to allow an application to use SIP service.
126
+
- "android.permission.PROCESS_OUTGOING_CALLS": permission to allow an application to see the number being dialed during an outgoing call with the option to redirect the call to a different number or abort the call altogether.
127
+
- "android.permission.SEND_SMS": permission to allow an application to send SMS messages.
128
+
- "android.permission.RECEIVE_SMS": permission to allow an application to receive SMS messages
129
+
- "android.permission.READ_SMS": permission to allow an application to read SMS messages.
130
+
- "android.permission.RECEIVE_WAP_PUSH": permission to allow an application to receive WAP push messages.
131
+
- "android.permission.RECEIVE_MMS": permission to allow an application to receive MMS messages.
132
+
- "android.permission.BODY_SENSORS": permission to allow an application to access data from sensors that the user uses to measure what is happening inside his/her body, such as heart rate.
133
+
134
+
Returns(boolean):
135
+
True if permission has been granted, false otherwise.
136
+
137
+
Description:
138
+
Use the <AndroidRequestPermission> command to request permission for
139
+
<pPermission> from the user.
140
+
141
+
>*Note:* Permission names are case sensitive.
142
+
*/
143
+
public handler AndroidRequestPermission(in pPermission as String) returns Boolean
144
+
variable tHasPermission as Boolean
145
+
unsafe
146
+
MCAndroidCheckRuntimePermission(pPermission)
147
+
put MCAndroidHasPermission(pPermission) into tHasPermission
148
+
end unsafe
149
+
return tHasPermission
150
+
end handler
151
+
152
+
private foreign handler MCAndroidCheckPermissionExists(in pPermission as String) \
153
+
returns CBool binds to "<builtin>"
154
+
155
+
/**
156
+
Summary:
157
+
Returns true if <pPermission> is a valid Android permission name
158
+
159
+
Parameters:
160
+
pPermission (string):
161
+
The name of the permission to check.
162
+
163
+
Returns(boolean):
164
+
True if <pPermission> is a valid Android permission name, false otherwise.
165
+
166
+
Description:
167
+
Use the <AndroidPermissionExists> function to check if <pPermission> is a valid
168
+
Android permission name.
169
+
170
+
>*Note:* Permission names are case sensitive.
171
+
*/
172
+
public handler AndroidPermissionExists(in pPermission as String) returns Boolean
173
+
variable tPermissionExists as Boolean
174
+
unsafe
175
+
put MCAndroidCheckPermissionExists(pPermission) into tPermissionExists
176
+
end unsafe
177
+
return tPermissionExists
178
+
end handler
179
+
180
+
private foreign handler MCAndroidHasPermission(in pPermission as String) \
181
+
returns CBool binds to "<builtin>"
182
+
183
+
/**
184
+
Summary:
185
+
Returns true if permission <pPermission> has been granted by the user.
186
+
187
+
Parameters:
188
+
pPermission (enum):
189
+
The name of the permission to request.
190
+
191
+
- "android.permission.READ_CALENDAR": permission to allow an application to read the device's calendar.
192
+
- "android.permission.WRITE_CALENDAR": permission to allow an application to write to the device's calendar.
193
+
- "android.permission.CAMERA": permission to allow an application to access the device's camera.
194
+
- "android.permission.ACCESS_COARSE_LOCATION": permission to allow an application to access the device's coarse location.
195
+
- "android.permission.ACCESS_FINE_LOCATION": permission to allow an application to access the device's fine location.
196
+
- "android.permission.READ_CONTACTS": permission to allow an application to read data from the device's contacts.
197
+
- "android.permission.WRITE_CONTACTS": permission to allow an application to write date to the device's contacts.
198
+
- "android.permission.GET_ACCOUNTS": permission to allow an application to access to the list of accounts in the Accounts Service.
199
+
- "android.permission.RECORD_AUDIO": permission to allow an application to allow an application to record audio.
200
+
- "android.permission.READ_EXTERNAL_STORAGE": permission to allow an application to read data from the device's external storage.
201
+
- "android.permission.WRITE_EXTERNAL_STORAGE": permission to allow an application to write data to the device's external storage.
202
+
- "android.permission.READ_PHONE_STATE": permission to allow an application to access phone state, including the phone number of the device, current cellular network information, the status of any ongoing calls, and a list of any PhoneAccounts registered on the device.
203
+
- "android.permission.READ_PHONE_NUMBERS": permission to allow an application to access the device's phone number(s).
204
+
- "android.permission.CALL_PHONE": permission to allow an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call.
205
+
- "android.permission.ANSWER_PHONE_CALLS": permission to allow an application to answer an incoming phone call.
206
+
- "android.permission.READ_CALL_LOG": permission to allow an application to read the user's call log.
207
+
- "android.permission.WRITE_CALL_LOG": permission to allow an application to write to the user's call log.
208
+
- "android.permission.ADD_VOICEMAIL": permission to allow an application to add voicemails into the system.
209
+
- "android.permission.USE_SIP": permission to allow an application to use SIP service.
210
+
- "android.permission.PROCESS_OUTGOING_CALLS": permission to allow an application to see the number being dialed during an outgoing call with the option to redirect the call to a different number or abort the call altogether.
211
+
- "android.permission.SEND_SMS": permission to allow an application to send SMS messages.
212
+
- "android.permission.RECEIVE_SMS": permission to allow an application to receive SMS messages
213
+
- "android.permission.READ_SMS": permission to allow an application to read SMS messages.
214
+
- "android.permission.RECEIVE_WAP_PUSH": permission to allow an application to receive WAP push messages.
215
+
- "android.permission.RECEIVE_MMS": permission to allow an application to receive MMS messages.
216
+
- "android.permission.BODY_SENSORS": permission to allow an application to access data from sensors that the user uses to measure what is happening inside his/her body, such as heart rate.
217
+
218
+
Returns(boolean):
219
+
True if permission has been granted, false otherwise.
220
+
221
+
Description:
222
+
Use the <AndroidHasPermission> function to find out if permission
223
+
<pPermission> has been granted by the user.
224
+
225
+
>*Note:* Permission names are case sensitive.
226
+
*/
227
+
public handler AndroidHasPermission(in pPermission as String) returns Boolean
228
+
variable tHasPermission as Boolean
229
+
unsafe
230
+
put MCAndroidHasPermission(pPermission) into tHasPermission
0 commit comments