1# SysCap (系统能力) 2 3系统能力(SystemCapability,简称SysCap),指操作系统中每一个相对独立的特性。不同的设备对应不同的系统能力集,每个系统能力对应一个或多个API。开发者可根据系统能力来判断是否可以使用某接口。 4 5> **说明:** 6> 7> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 8 9## canIUse 10 11canIUse(syscap: string): boolean 12 13查询系统是否具备某个系统能力。 14 15**系统能力:** SystemCapability.ArkUI.ArkUI.Full 16 17**参数:** 18 19| 参数名 | 类型 | 必填 | 说明 | 20| -------- | -------- | -------- | -------- | 21| syscap | string | 是 | 待查询的系统能力名称。 | 22 23**返回值:** 24 25| 类型 | 说明 | 26| -------- | -------- | 27| boolean | 系统能力查询结果,true表示系统具备该能力,false表示系统不具备。 | 28 29**示例:** 30 31 ```js 32import geoLocationManager from '@ohos.geoLocationManager' 33import { BusinessError } from '@ohos.base'; 34 35const isLocationAvailable = canIUse('SystemCapability.Location.Location.Core'); 36if (isLocationAvailable) { 37 geoLocationManager.getCurrentLocation((err: BusinessError, location: geoLocationManager.Location) => { 38 if (err) { 39 console.log('err=' + JSON.stringify(err)); 40 } 41 if (location) { 42 console.log('location=' + JSON.stringify(location)); 43 } 44 }); 45} else { 46 console.log('Location not by this device.'); 47} 48 ```