Difference between revisions of "Trigger: GPS Enabled/Disabled"

m
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<pre style="background-color: #EEEEEE; color: Black; border-radius: 10px; padding: 10px;">
+
<pre class="header-style">The GPS Enabled/Disabled trigger fires when the GPS-based location service is turned on or off on the device. This allows you to automate actions based on changes to the device's GPS/location provider state.</pre>
Will fire when GPS is turned on/off.</pre>
 
<br>
 
'''Example Usage'''<br/>
 
Prevents GPS from staying off (requires adb or root hack)
 
<pre style="background-color: #AC2424; color: white; border-radius: 10px; padding: 10px;">
 
Triggers
 
  
GPS disabled
+
''' Options '''
</pre><br>
 
<pre style="background-color: #1665B0; color: white; border-radius: 10px; padding: 10px;">
 
Actions
 
  
Location service ON
+
* '''GPS Enabled''': Trigger fires when GPS/location services are turned ON
</pre><br>
+
* '''GPS Disabled''': Trigger fires when GPS/location services are turned OFF
<pre style="background-color: green; color: white; border-radius: 10px; padding: 10px;">
 
Constraints
 
  
 +
''' Examples '''
  
</pre><br>
+
''Example 1: Notification When GPS Disabled''
<pre style="background-color: teal; color: white; border-radius: 10px; padding: 10px;">
+
  <pre class="trigger-style">Triggers
Local variables
 
  
 +
GPS Disabled</pre>
 +
  <pre class="action-style">Actions
  
</pre><br>
+
Popup Message - GPS has been disabled</pre>
 +
 
 +
Shows a popup notification when GPS is turned off.
 +
 
 +
''Example 2: Start Location Logging When GPS Enabled''
 +
  <pre class="trigger-style">Triggers
 +
 
 +
GPS Enabled</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Set Variable - gps_enabled = true
 +
Enable Macro - Location Logger</pre>
 +
 
 +
Sets a variable and enables a location logging macro when GPS is turned on.
 +
 
 +
''' Notes '''
 +
 
 +
* This trigger monitors the PROVIDERS_CHANGED_ACTION broadcast from the Android LocationManager.
 +
* It responds to changes in the GPS provider state, not the overall location services setting.
 +
* The trigger fires on state changes, not the current state. Use a GPS constraint if you need to check the current GPS state.
 +
 
 +
''' See Also '''
 +
 
 +
* [[Constraint:_GPS_State|GPS State Constraint]]
 +
* [[Trigger:_Location_Trigger|Location Trigger]]
 +
* [[Trigger:_Geofence_Trigger|Geofence Trigger]]

Latest revision as of 23:03, 5 January 2026

The GPS Enabled/Disabled trigger fires when the GPS-based location service is turned on or off on the device. This allows you to automate actions based on changes to the device's GPS/location provider state.

Options

  • GPS Enabled: Trigger fires when GPS/location services are turned ON
  • GPS Disabled: Trigger fires when GPS/location services are turned OFF

Examples

Example 1: Notification When GPS Disabled

Triggers

GPS Disabled
Actions

Popup Message - GPS has been disabled

Shows a popup notification when GPS is turned off.

Example 2: Start Location Logging When GPS Enabled

Triggers

GPS Enabled
Actions

Set Variable - gps_enabled = true
Enable Macro - Location Logger

Sets a variable and enables a location logging macro when GPS is turned on.

Notes

  • This trigger monitors the PROVIDERS_CHANGED_ACTION broadcast from the Android LocationManager.
  • It responds to changes in the GPS provider state, not the overall location services setting.
  • The trigger fires on state changes, not the current state. Use a GPS constraint if you need to check the current GPS state.

See Also