Lines Matching refs:resource

17 …o obtain a **ResourceManager** object based on **context** and call its resource management APIs w…
177 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
181 | 9001009 | Failed to access the system resource.which is not mapped to application sandbox, This …
320 |[_Resource](resource.md#resource-1)|Resource information of an application.|
330resource ID, resource name, or resource object. You can use **$r(resource address).id**, for examp…
332resource object for cross-package access in a multi-project application. It works by creating the …
334 …a-HAP and cross-HAP/HSP resource access modes, see [Resource Access](../../quick-start/resource-ca…
342 Obtains a string based on the specified resource ID. This API returns the result synchronously.
358 | string | String corresponding to the specified resource ID.|
362 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
367 | 9001001 | Invalid resource ID. |
368 | 9001002 | No matching resource is found based on the resource ID. |
369 | 9001006 | The resource is referenced cyclically. |
388 Obtains a string based on the specified resource ID and formats the string based on **args**. This …
405 | string | Formatted string corresponding to the specified resource ID.|
408 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
413 | 9001001 | Invalid resource ID. |
414 | 9001002 | No matching resource is found based on the resource ID. |
415 | 9001006 | The resource is referenced cyclically. |
416 | 9001007 | Failed to format the resource obtained based on the resource ID. |
433 getStringSync(resource: Resource): string
435 Obtains a string based on the specified resource object. This API returns the result synchronously.
447 | resource | [Resource](#resource9) | Yes | Resource object.|
453 | string | String corresponding to the specified resource object.|
457 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
462 | 9001001 | Invalid resource ID. |
463 | 9001002 | No matching resource is found based on the resource ID. |
464 | 9001006 | The resource is referenced cyclically. |
471 let resource: resourceManager.Resource = {
477 this.context.resourceManager.getStringSync(resource);
487 getStringSync(resource: Resource, ...args: Array<string | number>): string
489 Obtains a string based on the specified resource object and formats the string based on **args**. T…
501 | resource | [Resource](#resource9) | Yes | Resource object.|
508 | string | Formatted string corresponding to the specified resource object.|
511 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
516 | 9001001 | Invalid resource ID. |
517 | 9001002 | No matching resource is found based on the resource ID. |
518 | 9001006 | The resource is referenced cyclically. |
519 | 9001007 | Failed to format the resource obtained based on the resource ID. |
526 let resource: resourceManager.Resource = {
532 this.context.resourceManager.getStringSync(resource, "format string", 10, 98.78);
544 Obtains a string based on the specified resource name. This API returns the result synchronously.
560 | string | String corresponding to the specified resource name.|
564 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
569 | 9001003 | Invalid resource name. |
570 | 9001004 | No matching resource is found based on the resource name. |
571 | 9001006 | The resource is referenced cyclically. |
590 Obtains a string based on the specified resource name and formats the string based on **args**. Thi…
607 | string | Formatted string corresponding to the specified resource name.|
611 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
616 | 9001003 | Invalid resource name. |
617 | 9001004 | No matching resource is found based on the resource name. |
618 | 9001006 | The resource is referenced cyclically. |
619 | 9001008 | Failed to format the resource obtained based on the resource Name. |
638 Obtains a string based on the specified resource ID. This API uses an asynchronous callback to retu…
649 …allback used to return the result, which is the string corresponding to the specified resource ID.|
653 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
659 | 9001002 | No matching resource is found based on the resource ID. |
660 | 9001006 | The resource is referenced cyclically. |
685 Obtains a string based on the specified resource ID. This API uses a promise to return the result.
701 …Promise used to return the result, which is the string corresponding to the specified resource ID.|
705 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
710 | 9001001 | Invalid resource ID. |
711 | 9001002 | No matching resource is found based on the resource ID. |
712 | 9001006 | The resource is referenced cyclically. |
733 getStringValue(resource: Resource, callback: AsyncCallback&lt;string&gt;): void
735 Obtains a string based on the specified resource object. This API uses an asynchronous callback to …
747 | resource | [Resource](#resource9) | Yes | Resource object. |
748 …allback used to return the result, which is the string corresponding to the specified resource ID.|
752 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
757 | 9001001 | Invalid resource ID. |
758 | 9001002 | No matching resource is found based on the resource ID. |
759 | 9001006 | The resource is referenced cyclically. |
766 let resource: resourceManager.Resource = {
772 this.context.resourceManager.getStringValue(resource, (error: BusinessError, value: string) => {
788 getStringValue(resource: Resource): Promise&lt;string&gt;
790 Obtains a string based on the specified resource object. This API uses a promise to return the resu…
802 | resource | [Resource](#resource9) | Yes | Resource object.|
808 …ise used to return the result, which is the string corresponding to the specified resource object.|
812 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
817 | 9001001 | Invalid resource ID. |
818 | 9001002 | No matching resource is found based on the resource ID. |
819 | 9001006 | The resource is referenced cyclically. |
826 let resource: resourceManager.Resource = {
832 this.context.resourceManager.getStringValue(resource).then((value: string) => {
848 Obtains a string based on the specified resource name. This API uses an asynchronous callback to re…
859 …allback used to return the result, which is the string corresponding to the specified resource ID.|
862 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
867 | 9001003 | Invalid resource name. |
868 | 9001004 | No matching resource is found based on the resource name. |
869 | 9001006 | The resource is referenced cyclically. |
894 Obtains a string based on the specified resource name. This API uses a promise to return the result.
910 …omise used to return the result, which is the string corresponding to the specified resource name.|
914 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
919 | 9001003 | Invalid resource name. |
920 | 9001004 | No matching resource is found based on the resource name. |
921 | 9001006 | The resource is referenced cyclically. |
944 Obtains a string array based on the specified resource ID. This API returns the result synchronousl…
960 | Array&lt;string&gt; | String array corresponding to the specified resource ID.|
964 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
969 | 9001001 | Invalid resource ID. |
970 | 9001002 | No matching resource is found based on the resource ID. |
971 | 9001006 | The resource is referenced cyclically. |
988 getStringArrayValueSync(resource: Resource): Array&lt;string&gt;
990 Obtains a string array based on the specified resource object. This API returns the result synchron…
1002 | resource | [Resource](#resource9) | Yes | Resource object.|
1008 | Array&lt;string&gt; | String array corresponding to the specified resource object.|
1012 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1017 | 9001001 | Invalid resource ID. |
1018 | 9001002 | No matching resource is found based on the resource ID. |
1019 | 9001006 | The resource is referenced cyclically. |
1026 let resource: resourceManager.Resource = {
1032 this.context.resourceManager.getStringArrayValueSync(resource);
1044 Obtains a string array based on the specified resource name. This API returns the result synchronou…
1060 | Array&lt;string&gt; | String array corresponding to the specified resource name.|
1064 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1069 | 9001003 | Invalid resource name. |
1070 | 9001004 | No matching resource is found based on the resource name. |
1071 | 9001006 | The resource is referenced cyclically. |
1088 Obtains a string array based on the specified resource ID. This API uses an asynchronous callback t…
1099 …k used to return the result, which is the string array corresponding to the specified resource ID.|
1102 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1107 | 9001001 | Invalid resource ID. |
1108 | 9001002 | No matching resource is found based on the resource ID. |
1109 | 9001006 | The resource is referenced cyclically. |
1134 Obtains a string array based on the specified resource ID. This API uses a promise to return the re…
1150 …e used to return the result, which is the string array corresponding to the specified resource ID.|
1153 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1158 | 9001001 | Invalid resource ID. |
1159 | 9001002 | No matching resource is found based on the resource ID. |
1160 | 9001006 | The resource is referenced cyclically. |
1181 getStringArrayValue(resource: Resource, callback: AsyncCallback&lt;Array&lt;string&gt;&gt;): void
1183 Obtains a string array based on the specified resource object. This API uses an asynchronous callba…
1195 | resource | [Resource](#resource9) | Yes | Resource object. |
1196 …k used to return the result, which is the string array corresponding to the specified resource ID.|
1200 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1205 | 9001001 | Invalid resource ID. |
1206 | 9001002 | No matching resource is found based on the resource ID. |
1207 | 9001006 | The resource is referenced cyclically. |
1214 let resource: resourceManager.Resource = {
1220 …this.context.resourceManager.getStringArrayValue(resource, (error: BusinessError, value: Array<str…
1236 getStringArrayValue(resource: Resource): Promise&lt;Array&lt;string&gt;&gt;
1238 Obtains a string array based on the specified resource object. This API uses a promise to return th…
1250 | resource | [Resource](#resource9) | Yes | Resource object.|
1256 …ed to return the result, which is the string array corresponding to the specified resource object.|
1260 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1265 | 9001001 | Invalid resource ID. |
1266 | 9001002 | No matching resource is found based on the resource ID. |
1267 | 9001006 | The resource is referenced cyclically. |
1274 let resource: resourceManager.Resource = {
1280 this.context.resourceManager.getStringArrayValue(resource).then((value: Array<string>) => {
1296 Obtains a string array based on the specified resource name. This API uses an asynchronous callback…
1307 …k used to return the result, which is the string array corresponding to the specified resource ID.|
1311 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1316 | 9001003 | Invalid resource name. |
1317 | 9001004 | No matching resource is found based on the resource name. |
1318 | 9001006 | The resource is referenced cyclically. |
1343 Obtains a string array based on the specified resource name. This API uses a promise to return the …
1359 …used to return the result, which is the string array corresponding to the specified resource name.|
1363 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1368 | 9001003 | Invalid resource name. |
1369 | 9001004 | No matching resource is found based on the resource name. |
1370 | 9001006 | The resource is referenced cyclically. |
1393 Obtains a singular-plural string by the specified number based on the specified resource ID. This A…
1414 | string | Singular-plural string corresponding to the specified resource ID.|
1418 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1423 | 9001001 | Invalid resource ID. |
1424 | 9001002 | No matching resource is found based on the resource ID. |
1425 | 9001006 | The resource is referenced cyclically. |
1442 getPluralStringValueSync(resource: Resource, num: number): string
1444 Obtains a singular-plural string by the specified number based on the specified resource object. Th…
1460 | resource | [Resource](#resource9) | Yes | Resource object.|
1467 | string | Singular-plural string corresponding to the specified resource object.|
1471 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1476 | 9001001 | Invalid resource ID. |
1477 | 9001002 | No matching resource is found based on the resource ID. |
1478 | 9001006 | The resource is referenced cyclically. |
1485 let resource: resourceManager.Resource = {
1491 this.context.resourceManager.getPluralStringValueSync(resource, 1);
1503 Obtains a singular-plural string by the specified number based on the specified resource name. This…
1524 | string | Singular-plural string corresponding to the specified resource name.|
1528 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1533 | 9001003 | Invalid resource name. |
1534 | 9001004 | No matching resource is found based on the resource name. |
1535 | 9001006 | The resource is referenced cyclically. |
1554 Obtains a singular-plural string by the specified number based on the specified resource ID. This A…
1570 …return the result, which is the singular-plural string corresponding to the specified resource ID.|
1574 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1579 | 9001001 | Invalid resource ID. |
1580 | 9001002 | No matching resource is found based on the resource ID. |
1581 | 9001006 | The resource is referenced cyclically. |
1606 Obtains a singular-plural string by the specified number based on the specified resource ID. This A…
1627 …return the result, which is the singular-plural string corresponding to the specified resource ID.|
1631 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1636 | 9001001 | Invalid resource ID. |
1637 | 9001002 | No matching resource is found based on the resource ID. |
1638 | 9001006 | The resource is referenced cyclically. |
1659 getPluralStringValue(resource: Resource, num: number, callback: AsyncCallback&lt;string&gt;): void
1661 Obtains a singular-plural string by the specified number based on the specified resource object. Th…
1677 | resource | [Resource](#resource9) | Yes | Resource object. |
1679 …rn the result, which is the singular-plural string corresponding to the specified resource object.|
1683 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1688 | 9001001 | Invalid resource ID. |
1689 | 9001002 | No matching resource is found based on the resource ID. |
1690 | 9001006 | The resource is referenced cyclically. |
1697 let resource: resourceManager.Resource = {
1703 …this.context.resourceManager.getPluralStringValue(resource, 1, (error: BusinessError, value: strin…
1719 getPluralStringValue(resource: Resource, num: number): Promise&lt;string&gt;
1721 Obtains a singular-plural string by the specified number based on the specified resource object. Th…
1737 | resource | [Resource](#resource9) | Yes | Resource object.|
1744 …rn the result, which is the singular-plural string corresponding to the specified resource object.|
1748 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1753 | 9001001 | Invalid resource ID. |
1754 | 9001002 | No matching resource is found based on the resource ID. |
1755 | 9001006 | The resource is referenced cyclically. |
1762 let resource: resourceManager.Resource = {
1768 this.context.resourceManager.getPluralStringValue(resource, 1).then((value: string) => {
1784 Obtains a singular-plural string by the specified number based on the specified resource name. This…
1800 …turn the result, which is the singular-plural string corresponding to the specified resource name.|
1804 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1809 | 9001003 | Invalid resource name. |
1810 | 9001004 | No matching resource is found based on the resource name. |
1811 | 9001006 | The resource is referenced cyclically. |
1836 Obtains a singular-plural string by the specified number based on the specified resource name. This…
1857 …turn the result, which is the singular-plural string corresponding to the specified resource name.|
1861 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1866 | 9001003 | Invalid resource name. |
1867 | 9001004 | No matching resource is found based on the resource name. |
1868 | 9001006 | The resource is referenced cyclically. |
1891 …ile with the default or specified screen density based on the specified resource ID. This API retu…
1908 | Uint8Array | Content of the media file corresponding to the specified resource ID.|
1912 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1917 | 9001001 | Invalid resource ID. |
1918 | 9001002 | No matching resource is found based on the resource ID. |
1943 getMediaContentSync(resource: Resource, density?: number): Uint8Array
1945 …ile with the default or specified screen density based on the specified resource object. This API …
1957 | resource | [Resource](#resource9) | Yes | Resource object.|
1964 | Uint8Array | Content of the media file corresponding to the specified resource object.|
1968 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
1973 | 9001001 | Invalid resource ID. |
1974 | 9001002 | No matching resource is found based on the resource ID. |
1981 let resource: resourceManager.Resource = {
1987 this.context.resourceManager.getMediaContentSync(resource); // Default screen density
1995 this.context.resourceManager.getMediaContentSync(resource, 120); // Specified screen density
2007 …ile with the default or specified screen density based on the specified resource name. This API re…
2024 | Uint8Array | Content of the media file corresponding to the specified resource name.|
2028 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2033 | 9001003 | Invalid resource name. |
2034 | 9001004 | No matching resource is found based on the resource name. |
2061 Obtains the content of a media file based on the specified resource ID. This API uses an asynchrono…
2072 …urn the result, which is the content of the media file corresponding to the specified resource ID.|
2076 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2081 | 9001001 | Invalid resource ID. |
2082 | 9001002 | No matching resource is found based on the resource ID. |
2107 …f a media file with the specified screen density based on the specified resource ID. This API uses…
2119 …urn the result, which is the content of the media file corresponding to the specified resource ID.|
2123 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2128 | 9001001 | Invalid resource ID. |
2129 | 9001002 | No matching resource is found based on the resource ID. |
2154 Obtains the content of a media file based on the specified resource ID. This API uses a promise to …
2170 …urn the result, which is the content of the media file corresponding to the specified resource ID.|
2174 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2179 | 9001001 | Invalid resource ID. |
2180 | 9001002 | No matching resource is found based on the resource ID. |
2203 …f a media file with the specified screen density based on the specified resource ID. This API uses…
2220 …urn the result, which is the content of the media file corresponding to the specified resource ID.|
2224 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2229 | 9001001 | Invalid resource ID. |
2230 | 9001002 | No matching resource is found based on the resource ID. |
2251 getMediaContent(resource: Resource, callback: AsyncCallback&lt;Uint8Array&gt;): void
2253 Obtains the content of a media file based on the specified resource object. This API uses an asynch…
2265 | resource | [Resource](#resource9) | Yes | Resource object. |
2266 …urn the result, which is the content of the media file corresponding to the specified resource ID.|
2270 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2275 | 9001001 | Invalid resource ID. |
2276 | 9001002 | No matching resource is found based on the resource ID. |
2283 let resource: resourceManager.Resource = {
2289 …this.context.resourceManager.getMediaContent(resource, (error: BusinessError, value: Uint8Array) =…
2305 getMediaContent(resource: Resource, density: number, callback: AsyncCallback&lt;Uint8Array&gt;): vo…
2307 …f a media file with the specified screen density based on the specified resource object. This API …
2319 | resource | [Resource](#resource9) | Yes | Resource object. |
2321 …urn the result, which is the content of the media file corresponding to the specified resource ID.|
2325 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2330 | 9001001 | Invalid resource ID. |
2331 | 9001002 | No matching resource is found based on the resource ID. |
2338 let resource: resourceManager.Resource = {
2344 …this.context.resourceManager.getMediaContent(resource, 120, (error: BusinessError, value: Uint8Arr…
2360 getMediaContent(resource: Resource): Promise&lt;Uint8Array&gt;
2362 Obtains the content of a media file based on the specified resource object. This API uses a promise…
2374 | resource | [Resource](#resource9) | Yes | Resource object.|
2380 …the result, which is the content of the media file corresponding to the specified resource object.|
2384 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2389 | 9001001 | Invalid resource ID. |
2390 | 9001002 | No matching resource is found based on the resource ID. |
2397 let resource: resourceManager.Resource = {
2403 this.context.resourceManager.getMediaContent(resource).then((value: Uint8Array) => {
2417 getMediaContent(resource: Resource, density: number): Promise&lt;Uint8Array&gt;
2419 …f a media file with the specified screen density based on the specified resource object. This API …
2431 | resource | [Resource](#resource9) | Yes | Resource object.|
2438 …the result, which is the content of the media file corresponding to the specified resource object.|
2442 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2447 | 9001001 | Invalid resource ID. |
2448 | 9001002 | No matching resource is found based on the resource ID. |
2455 let resource: resourceManager.Resource = {
2461 this.context.resourceManager.getMediaContent(resource, 120).then((value: Uint8Array) => {
2477 Obtains the content of a media file based on the specified resource name. This API uses an asynchro…
2488 …urn the result, which is the content of the media file corresponding to the specified resource ID.|
2491 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2496 | 9001003 | Invalid resource name. |
2497 | 9001004 | No matching resource is found based on the resource name. |
2522 …f a media file with the specified screen density based on the specified resource name. This API us…
2534 …urn the result, which is the content of the media file corresponding to the specified resource ID.|
2538 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2543 | 9001003 | Invalid resource name. |
2544 | 9001004 | No matching resource is found based on the resource name. |
2569 Obtains the content of a media file based on the specified resource name. This API uses a promise t…
2585 …n the result, which is the content of the media file corresponding to the specified resource name.|
2589 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2594 | 9001003 | Invalid resource name. |
2595 | 9001004 | No matching resource is found based on the resource name. |
2618 …f a media file with the specified screen density based on the specified resource name. This API us…
2635 …n the result, which is the content of the media file corresponding to the specified resource name.|
2639 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2644 | 9001003 | Invalid resource name. |
2645 | 9001004 | No matching resource is found based on the resource name. |
2668 …age with the default or specified screen density based on the specified resource ID. This API retu…
2685 | string | Base64 code of the image corresponding to the specified resource ID.|
2689 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2694 | 9001001 | Invalid resource ID. |
2695 | 9001002 | No matching resource is found based on the resource ID. |
2720 getMediaContentBase64Sync(resource: Resource, density?: number): string
2722 …age with the default or specified screen density based on the specified resource object. This API …
2734 | resource | [Resource](#resource9) | Yes | Resource object.|
2741 | string | Base64 code of the image corresponding to the specified resource object.|
2745 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2750 | 9001001 | Invalid resource ID. |
2751 | 9001002 | No matching resource is found based on the resource ID. |
2758 let resource: resourceManager.Resource = {
2764 this.context.resourceManager.getMediaContentBase64Sync(resource); // Default screen density
2772 … this.context.resourceManager.getMediaContentBase64Sync(resource, 120); // Specified screen density
2784 …age with the default or specified screen density based on the specified resource name. This API re…
2801 | string | Base64 code of the image corresponding to the specified resource name.|
2805 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2810 | 9001003 | Invalid resource name. |
2811 | 9001004 | No matching resource is found based on the resource name. |
2838 Obtains the Base64 code of an image based on the specified resource ID. This API uses an asynchrono…
2849 …turn the result, which is the Base64 code of the image corresponding to the specified resource ID.|
2853 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2858 | 9001001 | Invalid resource ID. |
2859 | 9001002 | No matching resource is found based on the resource ID. |
2884 …de of an image with the specified screen density based on the specified resource ID. This API uses…
2896 …turn the result, which is the Base64 code of the image corresponding to the specified resource ID.|
2900 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2905 | 9001001 | Invalid resource ID. |
2906 | 9001002 | No matching resource is found based on the resource ID. |
2931 Obtains the Base64 code of an image based on the specified resource ID. This API uses a promise to …
2947 …turn the result, which is the Base64 code of the image corresponding to the specified resource ID.|
2951 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
2956 | 9001001 | Invalid resource ID. |
2957 | 9001002 | No matching resource is found based on the resource ID. |
2980 …de of an image with the specified screen density based on the specified resource ID. This API uses…
2997 …turn the result, which is the Base64 code of the image corresponding to the specified resource ID.|
3001 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3006 | 9001001 | Invalid resource ID. |
3007 | 9001002 | No matching resource is found based on the resource ID. |
3028 getMediaContentBase64(resource: Resource, callback: AsyncCallback&lt;string&gt;): void
3030 Obtains the Base64 code of an image based on the specified resource object. This API uses an asynch…
3042 | resource | [Resource](#resource9) | Yes | Resource object. |
3043 …turn the result, which is the Base64 code of the image corresponding to the specified resource ID.|
3047 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3052 | 9001001 | Invalid resource ID. |
3053 | 9001002 | No matching resource is found based on the resource ID. |
3060 let resource: resourceManager.Resource = {
3066 …this.context.resourceManager.getMediaContentBase64(resource, (error: BusinessError, value: string)…
3082 getMediaContentBase64(resource: Resource, density: number, callback: AsyncCallback&lt;string&gt;): …
3084 …de of an image with the specified screen density based on the specified resource object. This API …
3096 | resource | [Resource](#resource9) | Yes | Resource object. |
3098 …turn the result, which is the Base64 code of the image corresponding to the specified resource ID.|
3102 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3107 | 9001001 | Invalid resource ID. |
3108 | 9001002 | No matching resource is found based on the resource ID. |
3115 let resource: resourceManager.Resource = {
3121 …this.context.resourceManager.getMediaContentBase64(resource, 120, (error: BusinessError, value: st…
3137 getMediaContentBase64(resource: Resource): Promise&lt;string&gt;
3139 Obtains the Base64 code of an image based on the specified resource object. This API uses a promise…
3151 | resource | [Resource](#resource9) | Yes | Resource object.|
3157 … the result, which is the Base64 code of the image corresponding to the specified resource object.|
3161 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3166 | 9001001 | Invalid resource ID. |
3167 | 9001002 | No matching resource is found based on the resource ID. |
3174 let resource: resourceManager.Resource = {
3180 this.context.resourceManager.getMediaContentBase64(resource).then((value: string) => {
3194 getMediaContentBase64(resource: Resource, density: number): Promise&lt;string&gt;
3196 …de of an image with the specified screen density based on the specified resource object. This API …
3208 | resource | [Resource](#resource9) | Yes | Resource object.|
3215 … the result, which is the Base64 code of the image corresponding to the specified resource object.|
3219 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3224 | 9001001 | Invalid resource ID. |
3225 | 9001002 | No matching resource is found based on the resource ID. |
3232 let resource: resourceManager.Resource = {
3238 this.context.resourceManager.getMediaContentBase64(resource, 120).then((value: string) => {
3254 Obtains the Base64 code of an image based on the specified resource name. This API uses an asynchro…
3265 …turn the result, which is the Base64 code of the image corresponding to the specified resource ID.|
3269 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3274 | 9001003 | Invalid resource name. |
3275 | 9001004 | No matching resource is found based on the resource name. |
3300 …de of an image with the specified screen density based on the specified resource name. This API us…
3312 …turn the result, which is the Base64 code of the image corresponding to the specified resource ID.|
3316 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3321 | 9001003 | Invalid resource name. |
3322 | 9001004 | No matching resource is found based on the resource name. |
3347 Obtains the Base64 code of an image based on the specified resource name. This API uses a promise t…
3363 …rn the result, which is the Base64 code of the image corresponding to the specified resource name.|
3367 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3372 | 9001003 | Invalid resource name. |
3373 | 9001004 | No matching resource is found based on the resource name. |
3396 …de of an image with the specified screen density based on the specified resource name. This API us…
3413 …rn the result, which is the Base64 code of the image corresponding to the specified resource name.|
3417 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3422 | 9001003 | Invalid resource name. |
3423 | 9001004 | No matching resource is found based on the resource name. |
3446 Obtains a **DrawableDescriptor** object for icon display based on the specified resource ID. This A…
3458 …layered icon resource of the application in the theme resource package, and the value **0** or the…
3464 …md#drawabledescriptor) | **DrawableDescriptor** object corresponding to the specified resource ID.|
3468 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3473 | 9001001 | Invalid resource ID. |
3474 | 9001002 | No matching resource is found based on the resource ID. |
3505 getDrawableDescriptor(resource: Resource, density?: number, type?: number): DrawableDescriptor
3507 Obtains a **DrawableDescriptor** object for icon display based on the specified resource object. Th…
3519 | resource | [Resource](#resource9) | Yes | Resource object.|
3521 …layered icon resource of the application in the theme resource package, and the value **0** or the…
3527 …md#drawabledescriptor) | **DrawableDescriptor** object corresponding to the specified resource ID.|
3531 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3536 | 9001001 | Invalid resource ID. |
3537 | 9001002 | No matching resource is found based on the resource ID. |
3544 let resource: resourceManager.Resource = {
3550 this.context.resourceManager.getDrawableDescriptor(resource);
3557 this.context.resourceManager.getDrawableDescriptor(resource, 120);
3564 this.context.resourceManager.getDrawableDescriptor(resource, 0, 1);
3576 Obtains a **DrawableDescriptor** object for icon display based on the specified resource name. This…
3588 …layered icon resource of the application in the theme resource package, and the value **0** or the…
3594 …md#drawabledescriptor) | **DrawableDescriptor** object corresponding to the specified resource ID.|
3598 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3603 | 9001003 | Invalid resource name. |
3604 | 9001004 | No matching resource is found based on the resource name. |
3637 Obtains a Boolean result based on the specified resource ID. This API returns the result synchronou…
3653 | boolean | Boolean result corresponding to the specified resource ID.|
3657 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3662 | 9001001 | Invalid resource ID. |
3663 | 9001002 | No matching resource is found based on the resource ID. |
3664 | 9001006 | The resource is referenced cyclically. |
3680 getBoolean(resource: Resource): boolean
3682 Obtains a Boolean result based on the specified resource object. This API returns the result synchr…
3694 | resource | [Resource](#resource9) | Yes | Resource object.|
3700 | boolean | Boolean result corresponding to the specified resource object.|
3704 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3709 | 9001001 | Invalid resource ID. |
3710 | 9001002 | No matching resource is found based on the resource ID. |
3711 | 9001006 | The resource is referenced cyclically. |
3718 let resource: resourceManager.Resource = {
3724 this.context.resourceManager.getBoolean(resource);
3736 Obtains a Boolean result based on the specified resource name. This API returns the result synchron…
3752 | boolean | Boolean result corresponding to the specified resource name.|
3756 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3761 | 9001003 | Invalid resource name. |
3762 | 9001004 | No matching resource is found based on the resource name. |
3763 | 9001006 | The resource is referenced cyclically. |
3782 Obtains an integer or float value based on the specified resource ID. This API returns the result s…
3798 | number | Integer or float value corresponding to the specified resource ID. An integer indicates …
3802 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3807 | 9001001 | Invalid resource ID. |
3808 | 9001002 | No matching resource is found based on the resource ID. |
3809 | 9001006 | The resource is referenced cyclically. |
3834 getNumber(resource: Resource): number
3836 Obtains an integer or float value based on the specified resource object. This API returns the resu…
3840 …ue obtained through **resId** is different from that obtained through **resource**. In this case, …
3852 | resource | [Resource](#resource9) | Yes | Resource object.|
3858 | number | Integer or float value corresponding to the specified resource name.<br>An integer indic…
3862 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3867 | 9001001 | Invalid resource ID. |
3868 | 9001002 | No matching resource is found based on the resource ID. |
3869 | 9001006 | The resource is referenced cyclically. |
3876 let resource: resourceManager.Resource = {
3882 this.context.resourceManager.getNumber(resource);
3894 Obtains an integer or float value based on the specified resource name. This API returns the result…
3910 | number | Integer or float value corresponding to the specified resource name.<br>An integer indic…
3914 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3919 | 9001003 | Invalid resource name. |
3920 | 9001004 | No matching resource is found based on the resource name. |
3921 | 9001006 | The resource is referenced cyclically. |
3948 Obtains a color value based on the specified resource ID. This API returns the result synchronously.
3964 | number | Color value (decimal) corresponding to the specified resource ID.|
3968 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
3973 | 9001001 | Invalid resource ID. |
3974 | 9001002 | No matching resource is found based on the resource ID. |
3975 | 9001006 | The resource is referenced cyclically. |
3992 getColorSync(resource: Resource): number
3994 Obtains a color value based on the specified resource object. This API returns the result synchrono…
4006 | resource | [Resource](#resource9) | Yes | Resource object.|
4012 | number | Color value (decimal) corresponding to the specified resource object.|
4016 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4021 | 9001001 | Invalid resource ID. |
4022 | 9001002 | No matching resource is found based on the resource ID. |
4023 | 9001006 | The resource is referenced cyclically. |
4030 let resource: resourceManager.Resource = {
4036 this.context.resourceManager.getColorSync(resource);
4048 Obtains a color value based on the specified resource name. This API returns the result synchronous…
4064 | number | Color value (decimal) corresponding to the specified resource name.|
4068 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4073 | 9001003 | Invalid resource name. |
4074 | 9001004 | No matching resource is found based on the resource name. |
4075 | 9001006 | The resource is referenced cyclically. |
4094 Obtains a color value based on the specified resource ID. This API uses an asynchronous callback to…
4105 … return the result, which is the color value (decimal) corresponding to the specified resource ID.|
4109 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4115 | 9001002 | No matching resource is found based on the resource ID. |
4116 | 9001006 | The resource is referenced cyclically. |
4141 Obtains a color value based on the specified resource ID. This API uses a promise to return the res…
4157 … return the result, which is the color value (decimal) corresponding to the specified resource ID.|
4161 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4166 | 9001001 | Invalid resource ID. |
4167 | 9001002 | No matching resource is found based on the resource ID. |
4168 | 9001006 | The resource is referenced cyclically. |
4189 getColor(resource: Resource, callback: AsyncCallback&lt;number&gt;): void;
4191 Obtains a color value based on the specified resource object. This API uses an asynchronous callbac…
4203 | resource | [Resource](#resource9) | Yes | Resource object. |
4204 … return the result, which is the color value (decimal) corresponding to the specified resource ID.|
4208 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4213 | 9001001 | Invalid resource ID. |
4214 | 9001002 | No matching resource is found based on the resource ID. |
4215 | 9001006 | The resource is referenced cyclically. |
4222 let resource: resourceManager.Resource = {
4228 this.context.resourceManager.getColor(resource, (error: BusinessError, value: number) => {
4244 getColor(resource: Resource): Promise&lt;number&gt;;
4246 Obtains a color value based on the specified resource object. This API uses a promise to return the…
4258 | resource | [Resource](#resource9) | Yes | Resource object.|
4264 …urn the result, which is the color value (decimal) corresponding to the specified resource object.|
4268 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4273 | 9001001 | Invalid resource ID. |
4274 | 9001002 | No matching resource is found based on the resource ID. |
4275 | 9001006 | The resource is referenced cyclically. |
4282 let resource: resourceManager.Resource = {
4288 this.context.resourceManager.getColor(resource).then((value: number) => {
4304 Obtains a color value based on the specified resource name. This API uses an asynchronous callback …
4315 …eturn the result, which is the color value (decimal) corresponding to the specified resource name.|
4319 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4324 | 9001003 | Invalid resource name. |
4325 | 9001004 | No matching resource is found based on the resource name. |
4326 | 9001006 | The resource is referenced cyclically. |
4351 Obtains a color value based on the specified resource name. This API uses a promise to return the r…
4367 …eturn the result, which is the color value (decimal) corresponding to the specified resource name.|
4371 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4376 | 9001003 | Invalid resource name. |
4377 | 9001004 | No matching resource is found based on the resource name. |
4378 | 9001006 | The resource is referenced cyclically. |
4421 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4460 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4509 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4561 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4604 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4658 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4706 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4745 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4798 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4843 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4848 | 9001005 | The resource not found by path. |
4882 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
4887 | 9001005 | The resource not found by path. |
4930 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
5156 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
5195 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
5272 Obtains a symbol value based on the specified resource ID. This API returns the result synchronousl…
5288 | number | Symbol value (decimal) corresponding to the specified resource ID.|
5292 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
5297 | 9001001 | Invalid resource ID. |
5298 | 9001002 | No matching resource is found based on the resource ID. |
5299 | 9001006 | The resource is referenced cyclically. |
5315 getSymbol(resource: Resource): number
5317 Obtains a symbol value based on the specified resource object. This API returns the result synchron…
5329 | resource | [Resource](#resource9) | Yes | Resource object.|
5335 | number | Symbol value (decimal) corresponding to the specified resource object.|
5339 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
5344 | 9001001 | Invalid resource ID. |
5345 | 9001002 | No matching resource is found based on the resource ID. |
5346 | 9001006 | The resource is referenced cyclically. |
5353 let resource: resourceManager.Resource = {
5359 this.context.resourceManager.getSymbol(resource);
5371 Obtains a symbol value based on the specified resource name. This API returns the result synchronou…
5387 | number | Symbol value (decimal) corresponding to the specified resource name.|
5391 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
5396 | 9001003 | Invalid resource name. |
5397 | 9001004 | No matching resource is found based on the resource name. |
5398 | 9001006 | The resource is referenced cyclically. |
5437 For details about the error codes, see [Resource Manager Error Codes](errorcode-resource-manager.md…
5599 Obtains a string based on the specified resource ID. This API uses an asynchronous callback to retu…
5610 …allback used to return the result, which is the string corresponding to the specified resource ID.|
5630 Obtains a string based on the specified resource ID. This API uses a promise to return the result.
5646 …Promise used to return the result, which is the string corresponding to the specified resource ID.|
5666 Obtains a string array based on the specified resource ID. This API uses an asynchronous callback t…
5677 …k used to return the result, which is the string array corresponding to the specified resource ID.|
5697 Obtains a string array based on the specified resource ID. This API uses a promise to return the re…
5713 …e used to return the result, which is the string array corresponding to the specified resource ID.|
5733 Obtains the content of a media file based on the specified resource ID. This API uses an asynchrono…
5744 …urn the result, which is the content of the media file corresponding to the specified resource ID.|
5763 Obtains the content of a media file based on the specified resource ID. This API uses a promise to …
5779 …urn the result, which is the content of the media file corresponding to the specified resource ID.|
5799 Obtains the Base64 code of an image based on the specified resource ID. This API uses an asynchrono…
5810 …turn the result, which is the Base64 code of the image corresponding to the specified resource ID.|
5830 Obtains the Base64 code of an image based on the specified resource ID. This API uses a promise to …
5846 …turn the result, which is the Base64 code of the image corresponding to the specified resource ID.|
5866 Obtains a singular-plural string by the specified number based on the specified resource ID. This A…
5887 …return the result, which is the singular-plural string corresponding to the specified resource ID.|
5907 Obtains a singular-plural string by the specified number based on the specified resource ID. This A…
5923 …return the result, which is the singular-plural string corresponding to the specified resource ID.|