How to configure geographic location
Anbox Cloud allows specifying a geographic location for an Android container. This location can either be specified statically through a configuration file or dynamically through the HTTP API.
To specify a static location for an Android container, configure it in the
/var/lib/anbox/static_gps_position file within the instance.
The location data is constructed in the following format:
<Latitude>,<Latitude in hemisphere>,<Longitude>,<Longitude in hemisphere>
You can find details about the different parts of the location in the following table.
|Latitude||float||In the format of
|Latitude in hemisphere||char||Latitude hemisphere
|Longitude||float||In the format of
|Longitude in hemisphere||char||hemisphere
To make the file
/var/lib/anbox/static_gps_position available to the Android container, create a file that contains GPS data in the above format and move that file from
/var/lib/anbox/static_gps_position via an addon pre-start hook during the installation. When an Android container gets started and an application requests the current location information through the Android framework, the GPS data is then forwarded from the Anbox session to the application.
To update the geographic location of an Android container dynamically while the instance is running, use the location endpoint of the Anbox HTTP API.
See the documentation of the PATCH method for more information and the specification of the data format.
Last updated 20 days ago.