0

I have Delphi 10.1 and would like to

  1. Check if the Location sensor state is on for an android phone.
  2. If the Location sensor on the android phone is not on then switch it on via code using delphi.

I've seen another post here

That says its not possible. That post was created back in early 2016 so is the position still the same or is it now possible?

In a Delphi 10.1 Android project the Project|Option|User Permissions I have various options to "Modify Phone State" to even "Reboot"

Yuppski
  • 137
  • 2
  • 10
  • 1
    Security features are only getting stricter, so no it is not possible. Also you should upgrade your Delphi to newest version, you cannot upload application built with 10.1 to Play Store. Also new versions have support for requesting Android runtime permissions which are crucial for applications running on Android 6+ – Dalija Prasnikar Aug 14 '20 at 11:35
  • Example of asking for runtime permission (different one, but principle is the same) https://stackoverflow.com/questions/53579965/delphi-rio-fails-to-read-external-storage-with-read-external-storage-permissions – Dalija Prasnikar Aug 14 '20 at 11:38
  • @Dalija. Thanks for the reply. Is it possible to lock the Location sensor on the phone where the user cannot switch it off. Or lock the Location sensor on and is tricky to switch off? We are trying to monitor company phones locations. – Yuppski Aug 16 '20 at 07:14
  • 1
    AFAIK no - the whole point of those permissions and security features is to put user in control what is going on on their phone. Maybe on rooted phones. – Dalija Prasnikar Aug 16 '20 at 07:30

0 Answers0