- Print
- DarkLight
Automatically Setting the Device Location
Often it is helpful for an organization to determine the location of each device. This can be useful while managing the devices with certain Mobile Device Manager applications that can locate devices geographically.
To make this process easier, the location may be sent by the local Wi-Fi network as part of the Dynamic Host Configuration Protocol (DHCP) negotiation. The IT department can identify the real-world latitude and longitude of a rectangular area that is covered by their Wi-Fi network. Then any device that joins this network will know the approximate area in which they are located.
This approximate location is often accurate enough for many real world management tasks, eliminating the need for a precise GPS location. (Is this device in the warehouse in France or Denmark?)
To set this information for the devices, the IT administrator can use the tool on RFC 6225 Geolocation Generation Tool to define a rectangle that is covered by each Wi-Fi network. For situations such as college campuses, these can be very large imprecise rectangles spanning several miles. For situations where the Wi-Fi network covers only a single-building, the rectangle can be quite accurate to the physical location.
For example:
dhcp-option=123,4c:4d:cb:98:63:4b:65:ed:42:c2:02:03:c0:00:00:01
That information is then set in Option 123 of the DHCP packet. Once this is done, the device will automatically have a location with the accuracy defined by the Wi-Fi network. If a higher-precision or more recent location can be determined, the device will report that instead of the location obtained from DHCP.
Automatically Setting the Time Zone
Once a time server is used, the devices will know the correct time of day to a very high precisions in Coordinated Universal Time (UTC). In order for the devices to display the correct local time to the user, the device then must have the time zone set correctly.
The user may easily select the Time Zone during the First Time User Experience menus when setting up the new device, or from the Settings > System > Date & time menu.
The system may also automatically detect the time zone based on the location of the device when it can be detected.
For larger deployments, the time zone can be set using Mobile Device Manager (MDM) software by configuring the property “persist.sys.timezone“. However, for companies with devices in multiple locations, this creates a complexity that a unique MDM device profile would need to be used for each region.
An alternate mechanism is for the IT department to configure the Dynamic Host Configuration Protocol (DHCP) server to identify the time zone to all devices on the network. This can be done by setting option 101 with the string of the time zone name, for example:
dhcp-option=101,"America/New_York"
The advantage of this mechanism, is the IT department can customize the DHCP configuration for each location, and a single MDM profile can be used across all sites. If a device is ever moved from one location to another, the DHCP server will automatically update the time zone in the new location.
Automatically Setting the Device Time
The device can automatically set its time from a Network Time Protocol (NTP) server. By default the device will attempt to use the server pool.ntp.org, but there are several ways this server can be modified to ensure your device gets the correct time and date.
If you are using a Mobile Device Manager (MDM) you can change the global setting “ntp_server” with the hostname you would like.
This global setting can also be changed over USB using the Android Debug Bridge. Simply use a command of the format:
adb shell settings put global ntp_server asia.pool.ntp.org
Perhaps the easiest mechanism is to have your IT administrator enable the Dynamic Host Configuration Protocol (DHCP) server option 42 to tell the devices on the network which server to use. This allows the IT department to host an internal NTP server that will be used by all the devices on the isolated network. Or, the IT department can allow an external firewall rule to a 3rd party NTP server they trust. They simply enable Option 42 in the DHCP server to identify their preferred NTP server. Only one server will be used by the device. For example,
dhcp-option=42,192.168.0.1