PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → Problem with bluetooth permissions
Problem with bluetooth permissions
Started by Daniel, Nov., 13 2023 6:52 PM - No answer
Posted on November, 13 2023 - 6:52 PM
Friends, good morning.

My question is; do you know if WinDev Mobile has any function to reset the global state of an app after any special process. For example, I have an app that needs special bluetooth permissions such as android.permission.BLUETOOTH_CONNECT and android.permission.BLUETOOTH_SCAN. Now, these permissions are requested exactly after the splash screen of the app on the main screen. But a situation happens, and is that when trying to use a bluetooth printer apparently the app is not able to recognize that the permissions are already approved, so it generates an error in which indicates that any of those permissions that I mentioned is not approved by consequence generates a fatal error that closes the app, but when I open it again, load the splash screen and start, in this case if it recognizes the permissions. The error is only shown the first time the app is used after installation.

The code with which I request the permissions is something like this:
------------------------------------------------------------------------------------------------------------
gPermBtConn is Permission = PermissionList("android.permission.BLUETOOTH_CONNECT")
gPermBtScan is Permission = PermissionList("android.permission.BLUETOOTH_SCAN")
IF gPermBtConn.Granted AND gPermBtScan.Granted THEN
RETURN
ELSE
ToastDisplay("Remember to keep Bluetooth permissions enabled!",toastShort,vaMiddle,haCenter)
PermissionRequest(gPermBtConn,procedure(Permission Permission){})
PermissionRequest(gPermBtScan,procedure(Permission Permission Permission){}})
END
-------------------------------------------------------------------------------------------------------------
Therefore I request your help in guiding me if WinDev Mobile has any function that manages the status of the app and that allows to update it at runtime so that the app does not generate the error and recognizes the approved permissions from the first time, after installation on the device.

Thank you very much,
Regards.