15c735df2Sopenharmony_ci# Location<a name="EN-US_TOPIC_0000001080646118"></a> 25c735df2Sopenharmony_ci 35c735df2Sopenharmony_ci- [Introduction](#section11660541593) 45c735df2Sopenharmony_ci- [Directory Structure](#section161941989596) 55c735df2Sopenharmony_ci- [Constraints](#section119744591305) 65c735df2Sopenharmony_ci- [Usage](#section1312121216216) 75c735df2Sopenharmony_ci - [Available APIs](#section1551164914237) 85c735df2Sopenharmony_ci - [Usage Guidelines](#section129654513264) 95c735df2Sopenharmony_ci 105c735df2Sopenharmony_ci- [Repositories Involved](#section1371113476307) 115c735df2Sopenharmony_ci 125c735df2Sopenharmony_ci## Introduction<a name="section11660541593"></a> 135c735df2Sopenharmony_ci 145c735df2Sopenharmony_ciPeople take their mobile devices wherever they go. Mobile devices have become a necessity in people's daily routines, whether it be for looking at the weather forecast, browsing news, hailing a taxi, navigating, or recording data from a workout. All these activities are so much associated with the location services on mobile devices. 155c735df2Sopenharmony_ci 165c735df2Sopenharmony_ciWith the location awareness capability offered by OpenHarmony, mobile devices will be able to obtain real-time, accurate location data. Building location awareness into your application can also lead to a better contextual experience for application users. 175c735df2Sopenharmony_ci 185c735df2Sopenharmony_ciYour application can call location-specific APIs to obtain the location information of a mobile device for offering location-based services such as drive navigation and motion track recording. 195c735df2Sopenharmony_ci 205c735df2Sopenharmony_ci**Basic Concepts** 215c735df2Sopenharmony_ci 225c735df2Sopenharmony_ciLocation awareness helps determine where a mobile device locates. The system identifies the location of a mobile device with its coordinates, and uses location technologies such as Global Navigation Satellite System \(GNSS\) and network positioning \(for example, base station positioning or WLAN/Bluetooth positioning\) to provide diverse location-based services. These advanced location technologies make it possible to obtain the accurate location of the mobile device, regardless of whether it is indoors or outdoors. 235c735df2Sopenharmony_ci 245c735df2Sopenharmony_ci- **Coordinate** 255c735df2Sopenharmony_ci 265c735df2Sopenharmony_ci A coordinate describes a location on the earth using the longitude and latitude in reference to the World Geodetic Coordinate System 1984. 275c735df2Sopenharmony_ci 285c735df2Sopenharmony_ci- **GNSS positioning** 295c735df2Sopenharmony_ci 305c735df2Sopenharmony_ci GNSS positioning locates a mobile device by using the location algorithm offered by the device chip to compute the location information provided by the Global Navigation Satellite System, for example, GPS, GLONASS, BeiDou, and Galileo. Whichever positioning system will be used during the location process depends on a hardware capability of the device. 315c735df2Sopenharmony_ci 325c735df2Sopenharmony_ci- **Base station positioning** 335c735df2Sopenharmony_ci 345c735df2Sopenharmony_ci Base station positioning estimates the current location of a mobile device based on the location of the resident base station in reference to the neighboring base stations. This technology provides only a low accuracy and requires access to the cellular network. 355c735df2Sopenharmony_ci 365c735df2Sopenharmony_ci- **WLAN or Bluetooth positioning** 375c735df2Sopenharmony_ci 385c735df2Sopenharmony_ci WLAN or Bluetooth positioning estimates the current location of a mobile device based on the locations of WLANs and Bluetooth devices that can be discovered by the device. The location accuracy of this technology depends on the distribution of fixed WLAN access points \(APs\) and Bluetooth devices around the device. A high density of WLAN APs and Bluetooth devices can produce a more accurate location result than base station positioning. This technology also requires access to the network. 395c735df2Sopenharmony_ci 405c735df2Sopenharmony_ci 415c735df2Sopenharmony_ci**Figure 1** Location subsystem architecture<a name="fig4460722185514"></a> 425c735df2Sopenharmony_ci 435c735df2Sopenharmony_ci 445c735df2Sopenharmony_ci 455c735df2Sopenharmony_ci 465c735df2Sopenharmony_ci## Directory Structure<a name="section161941989596"></a> 475c735df2Sopenharmony_ci 485c735df2Sopenharmony_ci``` 495c735df2Sopenharmony_ci/base/location # Source code directory structure: 505c735df2Sopenharmony_ci ├── figures # Store the architecture diagram in readme 515c735df2Sopenharmony_ci ├── frameworks # Location framework code 525c735df2Sopenharmony_ci ├── interfaces # External interface 535c735df2Sopenharmony_ci ├── sa_profile # SA's profile 545c735df2Sopenharmony_ci ├── services # Directory of SA codes for location services 555c735df2Sopenharmony_ci ├── test # Test Code Directory 565c735df2Sopenharmony_ci``` 575c735df2Sopenharmony_ci 585c735df2Sopenharmony_ci## Constraints<a name="section119744591305"></a> 595c735df2Sopenharmony_ci 605c735df2Sopenharmony_ci - Your application can use the location function only after the user has granted the permission and turned on the function. If the location function is off, the system will not provide the location service for any application. 615c735df2Sopenharmony_ci 625c735df2Sopenharmony_ci - Since the location information is considered sensitive, your application still needs to obtain the location access permission from the user even if the user has turned on the location function. The system will provide the location service for your application only after it has been granted the permission to access the device location information. 635c735df2Sopenharmony_ci 645c735df2Sopenharmony_ci## Usage<a name="section1312121216216"></a> 655c735df2Sopenharmony_ci 665c735df2Sopenharmony_ci### Available APIs<a name="section1551164914237"></a> 675c735df2Sopenharmony_ci 685c735df2Sopenharmony_cihttps://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.geolocation.d.ts 695c735df2Sopenharmony_ci 705c735df2Sopenharmony_ci 715c735df2Sopenharmony_ci### Usage Guidelines<a name="section129654513264"></a> 725c735df2Sopenharmony_ci 735c735df2Sopenharmony_cihttps://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-geolocation.md 745c735df2Sopenharmony_ci 755c735df2Sopenharmony_ci 765c735df2Sopenharmony_ci## Repositories Involved<a name="section1371113476307"></a> 775c735df2Sopenharmony_ci 785c735df2Sopenharmony_cibase_location 795c735df2Sopenharmony_ci 80