-
Notifications
You must be signed in to change notification settings - Fork 14
Action tasks (Broadcasts)
Android Broadcasts is a mechanism through which applications in Android communicate. One application may send to second (or also internally between own components) piece of information bundled in [Intent] object. Mechanism how are data send is called broadcasting.
Samples at bottom.
Locus Map since version 3.31 supports the new bunch of commands, that are received as Broadcast intent with defined tasks & actions to do.
Every broadcast has to have defined tasks
parameter with well formatted JSON object. Tasks usually have other parameters. In most cases, it is action
parameter that defined sub-action. More in the definition below.
Every single task may have defined only single action
parameter with additional extra parameters. List below display all available tasks
and it's possible actions
.
Locus Map/Classic 3.38+
action: "on"
name: "Name of dashboard"
Display dashboard defined by its name over the main map screen.
action: "off"
Just hide the current active dashboard. Nothing happens if no dashboard is active.
value: "[name]"
Start certain "big" function (from internally defined functions, like these available for functions panel), defined by its unique text ID.
Possible values:
-
altitude_manager
: app altitude manager -
quick_action_menu
: action menu for fast access for predefined functions (since 3.36.0) -
screen_compass
: screen with compass -
screen_data
: screen with users points/tracks, opened on last visible tab -
screen_data_points
: screen with users points -
screen_data_tracks
: screen with users tracks -
screen_gps
: screen with GPS skyplot -
screen_map_items
: screen with "Map items" system -
screen_maps
: main app map manager -
screen_store
: Locus Store for download/purchase of additional content
Locus Map/Classic 3.49+
-
name: "Name of point"
(optional) lon: "Geographic longitude (-180°;180°)"
lat: "Geographic latitude (-90°;90°)"
Start guide to a certain point defined by name and coordinates.
action: "start"
-
name: "Name of configuration"
(optional)
Start Asamm based Live tracking, optionally with the certain configuration defined by name
(won't start if named configuration does not exist).
action: "stop"
-
name: "Name of configuration"
(optional)
Stop Asamm based Live tracking, optionally with the certain configuration defined by name
(won't stop if named configuration is not running).
action: "start"
-
name: "Name of configuration"
(optional)
Start custom-based Live tracking, optionally with the certain configuration defined by name
(won't start if named configuration does not exist).
action: "stop"
-
name: "Name of configuration"
(optional)
Stop custom-based Live tracking, optionally with the certain configuration defined by name
(won't stop if named configuration is not running).
action: "on"
Enable map centering.
action: "off"
Disable map centering.
action: "toggle"
Toggle map centering.
value: [+,-]X
-
unit: "[%,dp,px]"
(optional) -
keep_centering: "[true/false]"
(optional)
Move map in X-axis direction (+
=> right), by defined X
value. Optional units modify value
. Optional parameter keep_centering
allows to keep enabled "hold center".
value: [+,-]X
-
unit: "[%,dp,px]"
(optional) -
keep_centering: "[true/false]"
(optional)
Move map in Y-axis direction (+
=> bottom), by defined X
value. Optional units modify value
. Optional parameter keep_centering
allows to keep enabled "hold center".
Locus Map/Classic 3.38+
action: "on"
Enable map rotation.
action: "off"
Disable map rotation.
action: "toggle"
Toggle map rotation.
action: "+"
Perform zoom-in action.
action: "-"
Perform zoom-out action.
action: "value"
Zoom to a certain value (in range [1-26]
).
Sample tasks: { map_zoom: { action: "value", value: "20" } }
Locus Map/Classic 3.51+
-
name: "Name of point"
(optional) lon: "Geographic longitude (-180°;180°)"
lat: "Geographic latitude (-90°;90°)"
Start the "Navigate to" screen to a certain pre-set point defined by name and coordinates. There is still a need to manually trigger the start of navigation in the UI.
Choose only one of the possible actions.
action: "recalculate"
Recalculate current active navigation.
action: "stop"
Stop current navigation.
action: "menu"
Open app main menu.
action: "start"
name: "Name of preset"
Activate preset defined by its name.
Locus Map 4.0+
Execute a certain quick bookmark defined by its name.
action: "start"
name: "Name of the bookmark"
action: "on"
Enable screen lock on the main screen.
- or
action: "off"
Disable screen lock on the main screen.
action: "on"
Turn screen on.
- or
action: "off"
Turn screen off.
- or
action: "toggle"
Toggle screen on/off state.
action: "start"
-
name: "My profile"
(optional)
Check if optional name
is defined. If so, try to set a recording profile with the same name. In case of fail, ends this task. As the second step, start recording if it's not currently running.
action: "stop"
-
name: "My profile"
(optional) -
auto_save: [true,false]
(optional)
Stop track recording, optionally with automatic save of track. If name
is also defined, the recording will be stopped only in case, profile with the same name is currently active.
action: "pause"
-
name: "My profile"
(optional)
Pause active track recording. If name
is also defined, the recording will be paused only in case, profile with the same name is currently active.
action: "toggle"
-
allow_start: [true,false]
(optional, Locus Map 3.38+)
Allow toggling recording state. If the recording is running
, pause it, otherwise if is paused
, un-pause it. When recording is not running at all, nothing happens if parameter allow_start
is not set to true
action: "add_wpt"
-
name: "Point name"
(optional) -
auto_save: [true,false]
(optional) -
action_after: "[audio,photo,video]"
(optional)
Add waypoint to the current active recording. Extra parameters are optional and may predefine point name
, allow to save point automatically and also allows to take an audio/photo/video point directly.
Samples below show parameters that need to be defined for custom intents
or for example for Tasker application. All intents need to be sent as broadcasts
(in Tasker defined as Broadcast Receiver
).
The intent may have also defined a package parameter that say "which application should receive it". In case, you use Locus Map Free (Beta) and Locus Map Pro at once, or in case of target platform Android 8+, it is necessary to set this parameter too.
Locus Map Free (Beta): menion.android.locus
Locus Map Pro: menion.android.locus.pro
action: com.asamm.locus.ACTION_TASK
extra: tasks: { map_zoom: { action: "+" } }
to right and bottom by 25% of screen
action: com.asamm.locus.ACTION_TASK
extra: tasks: { map_move_x: { value: 25, unit: "%" }, map_move_y: { value: 25, unit: "%" } }
action: com.asamm.locus.ACTION_TASK
extra: tasks: { track_record: { action: "start", name: "Hiking" } }
action: com.asamm.locus.ACTION_TASK
extra: tasks: { function: { value: "quick_action_menu" } }
action: com.asamm.locus.ACTION_TASK
extra: tasks: { function: { value: "screen_compass" }, guide_to: { name: "My point", lon: 50.12345, lat: 15.12345 } }
-
Basics
-
Non-API tools
-
Using API
-
Work with points
-
Work with tracks
-
Integration into Locus Map
-
Other/advanced features