当前位置:网站首页>Arkui FAQ summary [Series 2]
Arkui FAQ summary [Series 2]
2022-07-19 15:25:00 【Hua Weiyun】
Today, I continue to sort out some problems encountered in the community
These are some of the questions I have answered , If you can really help developers , Then I'm honored
problem 1.ETS The application of cannot be in P40 Run on simulator ?
answer ,P40 The simulator is API 6,P40 PRO It's just API 7, then P50 yes API8, So when you use the simulator, look at your project using API That version of , Find the right one for you .
problem 2. data storage SharePreference How to use ?
answer :
1. The import module :import data_storage from '@ohos.data.storage';
2. Get the to be operated Storage example , Used for data storage operations The internal data storage path of the application is in brackets .
static store = data_storage.getStorageSync('/data/data/' + “string” );
3. Storing data
store .putSync(userId, value)
store.flushSync()
problem 3.ets How to load video resources ?

This loading method , Unable to play video on the development board .


answer , You are using DevEco Studio 3.0.0.900, There is no such thing as rawfile Resource folder , This version is uncommon by default , So we can't use this way of introduction , It's about using $r("app.media.viedeo.mp4")
problem 4.ETS Support chart Components ?
answer : It is not supported yet
problem 5. Excuse me, ets How to do it? Http request
ArkUI Development framework in @ohos.net.http The module provides network request related API,
launch http Network request requires application ohos.permission.INTERNET jurisdiction .
launch http The number of concurrent network requests is limited to 100 , Subsequent requests that exceed this limit will fail .
The default support
https, If you want to supporthttp, Need to be inconfig.jsonIncrease innetworklabel , Attribute identification "cleartextTraffic": true.
@ohos.net.http Module defined API The notes are very clear , First call createHttp() Method to get a HttpRequest example , And then call HttpRequest Of request() Method to send a network request .
Use @ohos.net.http The network request initiated by the module is divided into the following steps :
1. introduce http modular
import http from '@ohos.net.http';2. Create a httpRequest
let httpRequest = http.createHttp();3. launch http request
httpRequest Two types are available request() Method to make a network request , Respectively none RequestOptions The request and of parameters have RequestOptions Request for parameters .
Specific use , You can see my article :
边栏推荐
- 【用户文章】P4合并实践指南之实例拆解Resolve
- Is it safe to buy funds in a stock account? I want to buy funds for a long time
- Face technology: the picture of unclear people is repaired into a high-quality and high-definition image framework (with source code download)
- Internship is a barrier to enter the society
- 新基民在股票账户上买基金安全吗
- 【codeforces 1695C Zero Path】DP
- Wechat applet 6 cloud development cloud database
- 【Renesas RA6M4开发板之I2C读取mpu6050】
- FPGA (VGA Protocol Implementation)
- 2022-7-17
猜你喜欢

06_ Service call feign

Wechat applet 8 cloud function

ARM系统调用异常 汇编

E. Split Into Two Sets(种类并查集+染色法判二分图)
![[flower carving hands-on] interesting music visualization project (11) --ws2812 magic ribbon](/img/96/4b585caea47af2970d65b15516f571.jpg)
[flower carving hands-on] interesting music visualization project (11) --ws2812 magic ribbon

Discussion on ISP noise model 1

Servlet+JDBC表白墙

【用户文章】P4合并实践指南之实例拆解Resolve

PostgreSQL在Linux和Windows安装和入门基础教程
![[software testing] - a complete tutorial of postman interface testing tool](/img/4b/e8ee6fdf87d5b57adb8d3b6804c3ec.png)
[software testing] - a complete tutorial of postman interface testing tool
随机推荐
2020 ICPC Asia East continuous final g. Prof. Pang's sequence line segment tree / scan line
OSPF学习笔记(五)---重发布
队列的实现(循序存储,链式存储)
FMC sub card: 4-channel 12bit 3.2g, 2-channel 12bit, 6.4g AD acquisition / 5G acquisition card /6g acquisition card
Graph Cuts学习
PostgreSQL in Linux and windows installation and introductory basic tutorial
Selenium元素操作
232. 用栈实现队列
Is online account opening safe? I want to know where I can open an account in Nanning now?
P1004 [noip2000 improvement group] grid access
2022-7-17
Li Hongyi machine learning 2022.7.15 -- gradient descent
深层次观点看 AlphaGo 和李世石的 PK
用对工具,CI事半功倍
恒泰证券网上开户安全吗?
Est - il sûr d'ouvrir un compte en ligne pour acheter des fonds? Je viens de toucher le Fonds, je ne sais pas comment demander des conseils.
Is it safe for Hengtai securities to open an account online?
06_ Service call feign
您填写的保质期截止当前已经小于10天,不允许发布,若实际保质期大于10天,请如实填写生产日期与进货日期
网上开户安全么?想知道我现在在南宁,到哪里开户比较好?