提交 d6f78c0d 编写于 作者: S shawn_he

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 633fcf27
...@@ -15,7 +15,6 @@ Before getting started, you need to understand the following basic concepts: ...@@ -15,7 +15,6 @@ Before getting started, you need to understand the following basic concepts:
**Float16 inference**: a mode in which Float16 is used for inference. Float16, also called half-precision, uses 16 bits to represent a number. **Float16 inference**: a mode in which Float16 is used for inference. Float16, also called half-precision, uses 16 bits to represent a number.
## Available APIs ## Available APIs
APIs involved in MindSpore Lite model inference are categorized into context APIs, model APIs, and tensor APIs. APIs involved in MindSpore Lite model inference are categorized into context APIs, model APIs, and tensor APIs.
### Context APIs ### Context APIs
...@@ -54,6 +53,33 @@ The following figure shows the development process for MindSpore Lite model infe ...@@ -54,6 +53,33 @@ The following figure shows the development process for MindSpore Lite model infe
**Figure 1** Development process for MindSpore Lite model inference **Figure 1** Development process for MindSpore Lite model inference
![how-to-use-mindspore-lite](figures/01.png) ![how-to-use-mindspore-lite](figures/01.png)
Before moving to the main process, you need to reference related header files and compile functions to generate random input.
Example code:
```c
#include <stdlib.h>
#include <stdio.h>
#include "mindspore/model.h"
// Generate random input.
int GenerateInputDataWithRandom(OH_AI_TensorHandleArray inputs) {
for (size_t i = 0; i < inputs.handle_num; ++i) {
float *input_data = (float *)OH_AI_TensorGetMutableData(inputs.handle_list[i]);
if (input_data == NULL) {
printf("MSTensorGetMutableData failed.\n");
return OH_AI_STATUS_LITE_ERROR;
}
int64_t num = OH_AI_TensorGetElementNum(inputs.handle_list[i]);
const int divisor = 10;
for (size_t j = 0; j < num; j++) {
input_data[j] = (float)(rand() % divisor) / divisor; // 0--0.9f
}
}
return OH_AI_STATUS_SUCCESS;
}
```
The development process consists of the following main steps: The development process consists of the following main steps:
1. Prepare the required model. 1. Prepare the required model.
...@@ -101,8 +127,8 @@ The development process consists of the following main steps: ...@@ -101,8 +127,8 @@ The development process consists of the following main steps:
return OH_AI_STATUS_LITE_ERROR; return OH_AI_STATUS_LITE_ERROR;
} }
// Load and build the model. The model type is OH_AI_ModelTypeMindIR. // Load and build the model. The model type is OH_AI_MODELTYPE_MINDIR.
int ret = OH_AI_ModelBuildFromFile(model, argv[1], OH_AI_ModelTypeMindIR, context); int ret = OH_AI_ModelBuildFromFile(model, argv[1], OH_AI_MODELTYPE_MINDIR, context);
if (ret != OH_AI_STATUS_SUCCESS) { if (ret != OH_AI_STATUS_SUCCESS) {
printf("OH_AI_ModelBuildFromFile failed, ret: %d.\n", ret); printf("OH_AI_ModelBuildFromFile failed, ret: %d.\n", ret);
OH_AI_ModelDestroy(&model); OH_AI_ModelDestroy(&model);
...@@ -193,7 +219,7 @@ The development process consists of the following main steps: ...@@ -193,7 +219,7 @@ The development process consists of the following main steps:
dl dl
) )
``` ```
- To use ohos-sdk for cross compilation, you need to set the native toolchain path for the CMake tool as follows: `-DCMAKE_TOOLCHAIN_FILE="/xxx/ohos-sdk/linux/native/build/cmake/ohos.toolchain.cmake"`. - To use ohos-sdk for cross compilation, you need to set the native toolchain path for the CMake tool as follows: `-DCMAKE_TOOLCHAIN_FILE="/xxx/ohos-sdk/linux/native/build/cmake/ohos.toolchain.camke"`.
- The toolchain builds a 64-bit application by default. To build a 32-bit application, add the following configuration: `-DOHOS_ARCH="armeabi-v7a"`. - The toolchain builds a 64-bit application by default. To build a 32-bit application, add the following configuration: `-DOHOS_ARCH="armeabi-v7a"`.
...@@ -213,4 +239,4 @@ The development process consists of the following main steps: ...@@ -213,4 +239,4 @@ The development process consists of the following main steps:
Tensor name: Softmax-65, tensor size is 4004 ,elements num: 1001. Tensor name: Softmax-65, tensor size is 4004 ,elements num: 1001.
output data is: output data is:
0.000018 0.000012 0.000026 0.000194 0.000156 0.001501 0.000240 0.000825 0.000016 0.000006 0.000007 0.000004 0.000004 0.000004 0.000015 0.000099 0.000011 0.000013 0.000005 0.000023 0.000004 0.000008 0.000003 0.000003 0.000008 0.000014 0.000012 0.000006 0.000019 0.000006 0.000018 0.000024 0.000010 0.000002 0.000028 0.000372 0.000010 0.000017 0.000008 0.000004 0.000007 0.000010 0.000007 0.000012 0.000005 0.000015 0.000007 0.000040 0.000004 0.000085 0.000023 0.000018 0.000012 0.000026 0.000194 0.000156 0.001501 0.000240 0.000825 0.000016 0.000006 0.000007 0.000004 0.000004 0.000004 0.000015 0.000099 0.000011 0.000013 0.000005 0.000023 0.000004 0.000008 0.000003 0.000003 0.000008 0.000014 0.000012 0.000006 0.000019 0.000006 0.000018 0.000024 0.000010 0.000002 0.000028 0.000372 0.000010 0.000017 0.000008 0.000004 0.000007 0.000010 0.000007 0.000012 0.000005 0.000015 0.000007 0.000040 0.000004 0.000085 0.000023
``` ```
\ No newline at end of file
...@@ -48,7 +48,7 @@ on(type: 'locationChange', request: LocationRequest, callback: Callback&lt;Locat ...@@ -48,7 +48,7 @@ on(type: 'locationChange', request: LocationRequest, callback: Callback&lt;Locat
Registers a listener for location changes with a location request initiated. The location result is reported through [LocationRequest](#locationrequest). Registers a listener for location changes with a location request initiated. The location result is reported through [LocationRequest](#locationrequest).
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.on('locationChange')](js-apis-geoLocationManager.md#geolocationmanageronlocationchange). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.on('locationChange')](js-apis-geoLocationManager.md#geolocationmanageronlocationchange).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -64,7 +64,6 @@ Registers a listener for location changes with a location request initiated. The ...@@ -64,7 +64,6 @@ Registers a listener for location changes with a location request initiated. The
| callback | Callback&lt;[Location](#location)&gt; | Yes| Callback used to return the location change event.| | callback | Callback&lt;[Location](#location)&gt; | Yes| Callback used to return the location change event.|
**Example** **Example**
```ts ```ts
...@@ -83,7 +82,7 @@ off(type: 'locationChange', callback?: Callback&lt;Location&gt;): void ...@@ -83,7 +82,7 @@ off(type: 'locationChange', callback?: Callback&lt;Location&gt;): void
Unregisters the listener for location changes with the corresponding location request deleted. Unregisters the listener for location changes with the corresponding location request deleted.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.off('locationChange')](js-apis-geoLocationManager.md#geolocationmanagerofflocationchange). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.off('locationChange')](js-apis-geoLocationManager.md#geolocationmanagerofflocationchange).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -117,7 +116,7 @@ on(type: 'locationServiceState', callback: Callback&lt;boolean&gt;): void ...@@ -117,7 +116,7 @@ on(type: 'locationServiceState', callback: Callback&lt;boolean&gt;): void
Registers a listener for location service status change events. Registers a listener for location service status change events.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.on('locationEnabledChange')](js-apis-geoLocationManager.md#geolocationmanageronlocationenabledchange). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.on('locationEnabledChange')](js-apis-geoLocationManager.md#geolocationmanageronlocationenabledchange).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -149,7 +148,7 @@ off(type: 'locationServiceState', callback?: Callback&lt;boolean&gt;): void; ...@@ -149,7 +148,7 @@ off(type: 'locationServiceState', callback?: Callback&lt;boolean&gt;): void;
Unregisters the listener for location service status change events. Unregisters the listener for location service status change events.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.off('locationEnabledChange')](js-apis-geoLocationManager.md#geolocationmanagerofflocationenabledchange). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.off('locationEnabledChange')](js-apis-geoLocationManager.md#geolocationmanagerofflocationenabledchange).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -183,6 +182,7 @@ on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, ca ...@@ -183,6 +182,7 @@ on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, ca
Registers a listener for cached GNSS location reports. Registers a listener for cached GNSS location reports.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.on('cachedGnssLocationsChange')](js-apis-geoLocationManager.md#geolocationmanageroncachedgnsslocationschange). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.on('cachedGnssLocationsChange')](js-apis-geoLocationManager.md#geolocationmanageroncachedgnsslocationschange).
...@@ -218,6 +218,7 @@ off(type: 'cachedGnssLocationsReporting', callback?: Callback&lt;Array&lt;Locati ...@@ -218,6 +218,7 @@ off(type: 'cachedGnssLocationsReporting', callback?: Callback&lt;Array&lt;Locati
Unregisters the listener for cached GNSS location reports. Unregisters the listener for cached GNSS location reports.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.off('cachedGnssLocationsChange')](js-apis-geoLocationManager.md#geolocationmanageroffcachedgnsslocationschange). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.off('cachedGnssLocationsChange')](js-apis-geoLocationManager.md#geolocationmanageroffcachedgnsslocationschange).
...@@ -253,6 +254,7 @@ on(type: 'gnssStatusChange', callback: Callback&lt;SatelliteStatusInfo&gt;): voi ...@@ -253,6 +254,7 @@ on(type: 'gnssStatusChange', callback: Callback&lt;SatelliteStatusInfo&gt;): voi
Registers a listener for GNSS satellite status change events. Registers a listener for GNSS satellite status change events.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.on('satelliteStatusChange')](js-apis-geoLocationManager.md#geolocationmanageronsatellitestatuschange). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.on('satelliteStatusChange')](js-apis-geoLocationManager.md#geolocationmanageronsatellitestatuschange).
...@@ -286,6 +288,7 @@ off(type: 'gnssStatusChange', callback?: Callback&lt;SatelliteStatusInfo&gt;): v ...@@ -286,6 +288,7 @@ off(type: 'gnssStatusChange', callback?: Callback&lt;SatelliteStatusInfo&gt;): v
Unregisters the listener for GNSS satellite status change events. Unregisters the listener for GNSS satellite status change events.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.off('satelliteStatusChange')](js-apis-geoLocationManager.md#geolocationmanageroffsatellitestatuschange). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.off('satelliteStatusChange')](js-apis-geoLocationManager.md#geolocationmanageroffsatellitestatuschange).
...@@ -319,6 +322,7 @@ on(type: 'nmeaMessageChange', callback: Callback&lt;string&gt;): void; ...@@ -319,6 +322,7 @@ on(type: 'nmeaMessageChange', callback: Callback&lt;string&gt;): void;
Registers a listener for GNSS NMEA message change events. Registers a listener for GNSS NMEA message change events.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.on('nmeaMessage')](js-apis-geoLocationManager.md#geolocationmanageronnmeamessage). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.on('nmeaMessage')](js-apis-geoLocationManager.md#geolocationmanageronnmeamessage).
...@@ -352,6 +356,7 @@ off(type: 'nmeaMessageChange', callback?: Callback&lt;string&gt;): void; ...@@ -352,6 +356,7 @@ off(type: 'nmeaMessageChange', callback?: Callback&lt;string&gt;): void;
Unregisters the listener for GNSS NMEA message change events. Unregisters the listener for GNSS NMEA message change events.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.off('nmeaMessage')](js-apis-geoLocationManager.md#geolocationmanageroffnmeamessage). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.off('nmeaMessage')](js-apis-geoLocationManager.md#geolocationmanageroffnmeamessage).
...@@ -386,6 +391,7 @@ on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; ...@@ -386,6 +391,7 @@ on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void;
Registers a listener for status change events of the specified geofence. Registers a listener for status change events of the specified geofence.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.on('gnssFenceStatusChange')](js-apis-geoLocationManager.md#geolocationmanagerongnssfencestatuschange). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.on('gnssFenceStatusChange')](js-apis-geoLocationManager.md#geolocationmanagerongnssfencestatuschange).
...@@ -435,6 +441,7 @@ off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; ...@@ -435,6 +441,7 @@ off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void;
Unregisters the listener for status change events of the specified geofence. Unregisters the listener for status change events of the specified geofence.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.off('gnssFenceStatusChange')](js-apis-geoLocationManager.md#geolocationmanageroffgnssfencestatuschange). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.off('gnssFenceStatusChange')](js-apis-geoLocationManager.md#geolocationmanageroffgnssfencestatuschange).
...@@ -483,7 +490,7 @@ getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback&lt;L ...@@ -483,7 +490,7 @@ getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback&lt;L
Obtains the current location. This API uses an asynchronous callback to return the result. Obtains the current location. This API uses an asynchronous callback to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.getCurrentLocation](js-apis-geoLocationManager.md#geolocationmanagergetcurrentlocation). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.getCurrentLocation](js-apis-geoLocationManager.md#geolocationmanagergetcurrentlocation).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -521,7 +528,7 @@ getCurrentLocation(callback: AsyncCallback&lt;Location&gt;): void ...@@ -521,7 +528,7 @@ getCurrentLocation(callback: AsyncCallback&lt;Location&gt;): void
Obtains the current location. This API uses an asynchronous callback to return the result. Obtains the current location. This API uses an asynchronous callback to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.getCurrentLocation](js-apis-geoLocationManager.md#geolocationmanagergetcurrentlocation). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.getCurrentLocation](js-apis-geoLocationManager.md#geolocationmanagergetcurrentlocation).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -556,7 +563,7 @@ getCurrentLocation(request?: CurrentLocationRequest): Promise&lt;Location&gt; ...@@ -556,7 +563,7 @@ getCurrentLocation(request?: CurrentLocationRequest): Promise&lt;Location&gt;
Obtains the current location. This API uses a promise to return the result. Obtains the current location. This API uses a promise to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.getCurrentLocation](js-apis-geoLocationManager.md#geolocationmanagergetcurrentlocation-2). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.getCurrentLocation](js-apis-geoLocationManager.md#geolocationmanagergetcurrentlocation-2).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -593,7 +600,7 @@ getLastLocation(callback: AsyncCallback&lt;Location&gt;): void ...@@ -593,7 +600,7 @@ getLastLocation(callback: AsyncCallback&lt;Location&gt;): void
Obtains the previous location. This API uses an asynchronous callback to return the result. Obtains the previous location. This API uses an asynchronous callback to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.getLastLocation](js-apis-geoLocationManager.md#geolocationmanagergetlastlocation). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.getLastLocation](js-apis-geoLocationManager.md#geolocationmanagergetlastlocation).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -628,7 +635,7 @@ getLastLocation(): Promise&lt;Location&gt; ...@@ -628,7 +635,7 @@ getLastLocation(): Promise&lt;Location&gt;
Obtains the previous location. This API uses a promise to return the result. Obtains the previous location. This API uses a promise to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.getLastLocation](js-apis-geoLocationManager.md#geolocationmanagergetlastlocation). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.getLastLocation](js-apis-geoLocationManager.md#geolocationmanagergetlastlocation).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -658,7 +665,7 @@ isLocationEnabled(callback: AsyncCallback&lt;boolean&gt;): void ...@@ -658,7 +665,7 @@ isLocationEnabled(callback: AsyncCallback&lt;boolean&gt;): void
Checks whether the location service is enabled. This API uses an asynchronous callback to return the result. Checks whether the location service is enabled. This API uses an asynchronous callback to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.isLocationEnabled](js-apis-geoLocationManager.md#geolocationmanagerislocationenabled). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.isLocationEnabled](js-apis-geoLocationManager.md#geolocationmanagerislocationenabled).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -692,7 +699,7 @@ isLocationEnabled(): Promise&lt;boolean&gt; ...@@ -692,7 +699,7 @@ isLocationEnabled(): Promise&lt;boolean&gt;
Checks whether the location service is enabled. This API uses a promise to return the result. Checks whether the location service is enabled. This API uses a promise to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.isLocationEnabled](js-apis-geoLocationManager.md#geolocationmanagerislocationenabled). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.isLocationEnabled](js-apis-geoLocationManager.md#geolocationmanagerislocationenabled).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -721,7 +728,7 @@ requestEnableLocation(callback: AsyncCallback&lt;boolean&gt;): void ...@@ -721,7 +728,7 @@ requestEnableLocation(callback: AsyncCallback&lt;boolean&gt;): void
Requests to enable the location service. This API uses an asynchronous callback to return the result. Requests to enable the location service. This API uses an asynchronous callback to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.requestEnableLocation](js-apis-geoLocationManager.md#geolocationmanagerrequestenablelocation). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.requestEnableLocation](js-apis-geoLocationManager.md#geolocationmanagerrequestenablelocation).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -755,7 +762,7 @@ requestEnableLocation(): Promise&lt;boolean&gt; ...@@ -755,7 +762,7 @@ requestEnableLocation(): Promise&lt;boolean&gt;
Requests to enable the location service. This API uses a promise to return the result. Requests to enable the location service. This API uses a promise to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.requestEnableLocation](js-apis-geoLocationManager.md#geolocationmanagerrequestenablelocation-1). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.requestEnableLocation](js-apis-geoLocationManager.md#geolocationmanagerrequestenablelocation-1).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -784,7 +791,7 @@ isGeoServiceAvailable(callback: AsyncCallback&lt;boolean&gt;): void ...@@ -784,7 +791,7 @@ isGeoServiceAvailable(callback: AsyncCallback&lt;boolean&gt;): void
Checks whether the (reverse) geocoding service is available. This API uses an asynchronous callback to return the result. Checks whether the (reverse) geocoding service is available. This API uses an asynchronous callback to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.isGeocoderAvailable](js-apis-geoLocationManager.md#geolocationmanagerisgeocoderavailable). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.isGeocoderAvailable](js-apis-geoLocationManager.md#geolocationmanagerisgeocoderavailable).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -818,7 +825,7 @@ isGeoServiceAvailable(): Promise&lt;boolean&gt; ...@@ -818,7 +825,7 @@ isGeoServiceAvailable(): Promise&lt;boolean&gt;
Checks whether the (reverse) geocoding service is available. This API uses a promise to return the result. Checks whether the (reverse) geocoding service is available. This API uses a promise to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.isGeocoderAvailable](js-apis-geoLocationManager.md#geolocationmanagerisgeocoderavailable). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.isGeocoderAvailable](js-apis-geoLocationManager.md#geolocationmanagerisgeocoderavailable).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -847,7 +854,7 @@ getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback ...@@ -847,7 +854,7 @@ getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback
Converts coordinates into geographic description through reverse geocoding. This API uses an asynchronous callback to return the result. Converts coordinates into geographic description through reverse geocoding. This API uses an asynchronous callback to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.getAddressesFromLocation](js-apis-geoLocationManager.md#geolocationmanagergetaddressesfromlocation). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.getAddressesFromLocation](js-apis-geoLocationManager.md#geolocationmanagergetaddressesfromlocation).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -883,7 +890,7 @@ getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise&lt;Array&lt;Ge ...@@ -883,7 +890,7 @@ getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise&lt;Array&lt;Ge
Converts coordinates into geographic description through reverse geocoding. This API uses a promise to return the result. Converts coordinates into geographic description through reverse geocoding. This API uses a promise to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.getAddressesFromLocation](js-apis-geoLocationManager.md#geolocationmanagergetaddressesfromlocation-1). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.getAddressesFromLocation](js-apis-geoLocationManager.md#geolocationmanagergetaddressesfromlocation-1).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -919,7 +926,7 @@ getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback&lt ...@@ -919,7 +926,7 @@ getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback&lt
Converts geographic description into coordinates through geocoding. This API uses an asynchronous callback to return the result. Converts geographic description into coordinates through geocoding. This API uses an asynchronous callback to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.getAddressesFromLocationName](js-apis-geoLocationManager.md#geolocationmanagergetaddressesfromlocationname). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.getAddressesFromLocationName](js-apis-geoLocationManager.md#geolocationmanagergetaddressesfromlocationname).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -955,7 +962,7 @@ getAddressesFromLocationName(request: GeoCodeRequest): Promise&lt;Array&lt;GeoAd ...@@ -955,7 +962,7 @@ getAddressesFromLocationName(request: GeoCodeRequest): Promise&lt;Array&lt;GeoAd
Converts geographic description into coordinates through geocoding. This API uses a promise to return the result. Converts geographic description into coordinates through geocoding. This API uses a promise to return the result.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.getAddressesFromLocationName](js-apis-geoLocationManager.md#geolocationmanagergetaddressesfromlocationname-1). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.getAddressesFromLocationName](js-apis-geoLocationManager.md#geolocationmanagergetaddressesfromlocationname-1).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -992,6 +999,7 @@ getCachedGnssLocationsSize(callback: AsyncCallback&lt;number&gt;): void; ...@@ -992,6 +999,7 @@ getCachedGnssLocationsSize(callback: AsyncCallback&lt;number&gt;): void;
Obtains the number of cached GNSS locations. Obtains the number of cached GNSS locations.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.getCachedGnssLocationsSize](js-apis-geoLocationManager.md#geolocationmanagergetcachedgnsslocationssize). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.getCachedGnssLocationsSize](js-apis-geoLocationManager.md#geolocationmanagergetcachedgnsslocationssize).
...@@ -1027,6 +1035,7 @@ getCachedGnssLocationsSize(): Promise&lt;number&gt;; ...@@ -1027,6 +1035,7 @@ getCachedGnssLocationsSize(): Promise&lt;number&gt;;
Obtains the number of cached GNSS locations. Obtains the number of cached GNSS locations.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.getCachedGnssLocationsSize](js-apis-geoLocationManager.md#geolocationmanagergetcachedgnsslocationssize-1). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.getCachedGnssLocationsSize](js-apis-geoLocationManager.md#geolocationmanagergetcachedgnsslocationssize-1).
...@@ -1057,6 +1066,7 @@ flushCachedGnssLocations(callback: AsyncCallback&lt;boolean&gt;): void; ...@@ -1057,6 +1066,7 @@ flushCachedGnssLocations(callback: AsyncCallback&lt;boolean&gt;): void;
Obtains all cached GNSS locations and clears the GNSS cache queue. Obtains all cached GNSS locations and clears the GNSS cache queue.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.flushCachedGnssLocations](js-apis-geoLocationManager.md#geolocationmanagerflushcachedgnsslocations). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.flushCachedGnssLocations](js-apis-geoLocationManager.md#geolocationmanagerflushcachedgnsslocations).
...@@ -1092,6 +1102,7 @@ flushCachedGnssLocations(): Promise&lt;boolean&gt;; ...@@ -1092,6 +1102,7 @@ flushCachedGnssLocations(): Promise&lt;boolean&gt;;
Obtains all cached GNSS locations and clears the GNSS cache queue. Obtains all cached GNSS locations and clears the GNSS cache queue.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.flushCachedGnssLocations](js-apis-geoLocationManager.md#geolocationmanagerflushcachedgnsslocations-1). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.flushCachedGnssLocations](js-apis-geoLocationManager.md#geolocationmanagerflushcachedgnsslocations-1).
...@@ -1122,6 +1133,7 @@ sendCommand(command: LocationCommand, callback: AsyncCallback&lt;boolean&gt;): v ...@@ -1122,6 +1133,7 @@ sendCommand(command: LocationCommand, callback: AsyncCallback&lt;boolean&gt;): v
Sends an extended command to the location subsystem. Sends an extended command to the location subsystem.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.sendCommand](js-apis-geoLocationManager.md#geolocationmanagersendcommand). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.sendCommand](js-apis-geoLocationManager.md#geolocationmanagersendcommand).
...@@ -1159,6 +1171,7 @@ sendCommand(command: LocationCommand): Promise&lt;boolean&gt;; ...@@ -1159,6 +1171,7 @@ sendCommand(command: LocationCommand): Promise&lt;boolean&gt;;
Sends an extended command to the location subsystem. Sends an extended command to the location subsystem.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.sendCommand](js-apis-geoLocationManager.md#geolocationmanagersendcommand). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.sendCommand](js-apis-geoLocationManager.md#geolocationmanagersendcommand).
...@@ -1193,7 +1206,7 @@ Sends an extended command to the location subsystem. ...@@ -1193,7 +1206,7 @@ Sends an extended command to the location subsystem.
Sets the priority of the location request. Sets the priority of the location request.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.LocationRequestPriority](js-apis-geoLocationManager.md#locationrequestpriority). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.LocationRequestPriority](js-apis-geoLocationManager.md#locationrequestpriority).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -1212,7 +1225,7 @@ Sets the priority of the location request. ...@@ -1212,7 +1225,7 @@ Sets the priority of the location request.
Sets the scenario of the location request. Sets the scenario of the location request.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.LocationRequestScenario](js-apis-geoLocationManager.md#locationrequestscenario). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.LocationRequestScenario](js-apis-geoLocationManager.md#locationrequestscenario).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -1233,7 +1246,7 @@ Sets the priority of the location request. ...@@ -1233,7 +1246,7 @@ Sets the priority of the location request.
Enumerates error codes of the location service. Enumerates error codes of the location service.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. > This API is deprecated since API version 9.
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -1255,7 +1268,7 @@ Enumerates error codes of the location service. ...@@ -1255,7 +1268,7 @@ Enumerates error codes of the location service.
Defines a reverse geocoding request. Defines a reverse geocoding request.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.ReverseGeoCodeRequest](js-apis-geoLocationManager.md#reversegeocoderequest). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.ReverseGeoCodeRequest](js-apis-geoLocationManager.md#reversegeocoderequest).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -1274,7 +1287,7 @@ Defines a reverse geocoding request. ...@@ -1274,7 +1287,7 @@ Defines a reverse geocoding request.
Defines a geocoding request. Defines a geocoding request.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.GeoCodeRequest](js-apis-geoLocationManager.md#geocoderequest). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.GeoCodeRequest](js-apis-geoLocationManager.md#geocoderequest).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -1296,7 +1309,7 @@ Defines a geocoding request. ...@@ -1296,7 +1309,7 @@ Defines a geocoding request.
Defines a geographic location. Defines a geographic location.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.GeoAddress](js-apis-geoLocationManager.md#geoaddress). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.GeoAddress](js-apis-geoLocationManager.md#geoaddress).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -1329,7 +1342,7 @@ Defines a geographic location. ...@@ -1329,7 +1342,7 @@ Defines a geographic location.
Defines a location request. Defines a location request.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.LocationRequest](js-apis-geoLocationManager.md#locationrequest). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.LocationRequest](js-apis-geoLocationManager.md#locationrequest).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -1349,7 +1362,7 @@ Defines a location request. ...@@ -1349,7 +1362,7 @@ Defines a location request.
Defines the current location request. Defines the current location request.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.CurrentLocationRequest](js-apis-geoLocationManager.md#currentlocationrequest). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.CurrentLocationRequest](js-apis-geoLocationManager.md#currentlocationrequest).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
...@@ -1369,6 +1382,7 @@ Defines the current location request. ...@@ -1369,6 +1382,7 @@ Defines the current location request.
Defines the satellite status information. Defines the satellite status information.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.SatelliteStatusInfo](js-apis-geoLocationManager.md#satellitestatusinfo). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.SatelliteStatusInfo](js-apis-geoLocationManager.md#satellitestatusinfo).
...@@ -1391,6 +1405,7 @@ Defines the satellite status information. ...@@ -1391,6 +1405,7 @@ Defines the satellite status information.
Represents a request for reporting cached GNSS locations. Represents a request for reporting cached GNSS locations.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.CachedGnssLocationsRequest](js-apis-geoLocationManager.md#cachedgnsslocationsrequest). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.CachedGnssLocationsRequest](js-apis-geoLocationManager.md#cachedgnsslocationsrequest).
...@@ -1409,6 +1424,7 @@ Represents a request for reporting cached GNSS locations. ...@@ -1409,6 +1424,7 @@ Represents a request for reporting cached GNSS locations.
Defines a GNSS geofence. Currently, only circular geofences are supported. Defines a GNSS geofence. Currently, only circular geofences are supported.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.Geofence](js-apis-geoLocationManager.md#geofence). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.Geofence](js-apis-geoLocationManager.md#geofence).
...@@ -1429,6 +1445,7 @@ Defines a GNSS geofence. Currently, only circular geofences are supported. ...@@ -1429,6 +1445,7 @@ Defines a GNSS geofence. Currently, only circular geofences are supported.
Represents a GNSS geofencing request. Represents a GNSS geofencing request.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.GeofenceRequest](js-apis-geoLocationManager.md#geofencerequest). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.GeofenceRequest](js-apis-geoLocationManager.md#geofencerequest).
...@@ -1448,6 +1465,7 @@ Represents a GNSS geofencing request. ...@@ -1448,6 +1465,7 @@ Represents a GNSS geofencing request.
Defines the privacy statement type. Defines the privacy statement type.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.LocationPrivacyType](js-apis-geoLocationManager.md#locationprivacytype). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.LocationPrivacyType](js-apis-geoLocationManager.md#locationprivacytype).
...@@ -1467,6 +1485,7 @@ Defines the privacy statement type. ...@@ -1467,6 +1485,7 @@ Defines the privacy statement type.
Defines an extended command. Defines an extended command.
> **NOTE** > **NOTE**
>
> This API is supported since API version 8. > This API is supported since API version 8.
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.LocationCommand](js-apis-geoLocationManager.md#locationcommand). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.LocationCommand](js-apis-geoLocationManager.md#locationcommand).
...@@ -1484,7 +1503,7 @@ Defines an extended command. ...@@ -1484,7 +1503,7 @@ Defines an extended command.
Defines a location. Defines a location.
> **NOTE** > **NOTE**<br>
> This API is deprecated since API version 9. You are advised to use [geoLocationManager.Location](js-apis-geoLocationManager.md#location). > This API is deprecated since API version 9. You are advised to use [geoLocationManager.Location](js-apis-geoLocationManager.md#location).
**Required permissions**: ohos.permission.LOCATION **Required permissions**: ohos.permission.LOCATION
......
# Geographic Location # Geographic Location
> **NOTE** > **NOTE**
>
> - The APIs of this module are no longer maintained since API version 7. You are advised to use [`@ohos.geolocation`](js-apis-geolocation.md). > - The APIs of this module are no longer maintained since API version 7. You are advised to use [`@ohos.geolocation`](js-apis-geolocation.md).
> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......
# Network State # @system.network (Network State)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **Note:** > **NOTE**
> - The APIs of this module are no longer maintained since API version 7. It is recommended that you use [`@ohos.telephony.observer`](js-apis-observer.md) instead.
> >
> - The APIs of this module are no longer maintained since API version 7. It is recommended that you use [`@ohos.telephony.observer`](js-apis-observer.md) instead.
> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......
# @system.request # @system.request (Upload and Download)
The **system.request** module provides applications with basic upload and download capabilities. The **system.request** module provides applications with basic upload and download capabilities.
> **NOTE** > **NOTE**
> - The APIs of this module are deprecated since API version 9. You are advised to use [`@ohos.request`](js-apis-request.md) instead.
> >
> - The APIs of this module are deprecated since API version 9. You are advised to use [`@ohos.request`](js-apis-request.md) instead.
> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册