• Home
Name Date Size #Lines LOC

..--

AppScope/12-May-2024-3633

entry/12-May-2024-1,8241,654

screenshots/device/12-May-2024-

.gitignoreD12-May-2024143 1211

README.mdD12-May-20241.1 KiB2413

README_zh.mdD12-May-20242.5 KiB3623

build-profile.json5D12-May-20241,019 4240

hvigorfile.tsD12-May-2024158 21

package.jsonD12-May-2024371 1918

README.md

1# SMS
2
3### Introduction
4
5This sample shows how to send SMS messages.
6
7### Usage
8
91. On the home page, click **Create Contact**. In the displayed dialog box, enter the contact name and phone number, and click **OK**. The contact is added to the contact list.
10
112. Click **Manage**. The button changes to **Cancel**, and the **x** sign is displayed on the contact list. Click the **x** sign if you want to delete a contact. Click **Cancel** if you want to quit, and the button changes back to **Manage**.
12
133. The **Send Message** icon is displayed on the right of each contact in the contact list. Click the icon to go to the page for sending SMS messages.
14
154. On the page for sending SMS messages, enter a message and click **Send** to send it.
16
17Note:
18- SMS messages can be successfully sent only when the required permission is granted and a SIM card is inserted. They are sent from the default SIM card.
19- Preset SMS messages are provided. Storage function is not available, and application data will be cleared each time you exit.
20
21### Constraints
22
23This sample can only be run on standard-system devices.
24

README_zh.md

1# 短信服务
2
3### 简介
4
5本示例展示了电话服务中发送短信的功能。
6
7使用说明:
8
91. 首页点击**创建联系人**,弹框输入联系人姓名和电话,点击确定按钮后,联系人列表中添加该联系人。
102. 点击**管理**,该按钮变成**取消**,联系人列表出现删除x按钮,点击x按钮可删除联系人,点击**取消**,按钮变成**管理**。
113. 联系人列表中每个联系人右侧有**发送短信**图标按钮,点击该图标按钮跳转到发送短信页面。
124. 发送短信页面,输入短信点击向上箭头的**发送**按钮,可以发送短信。
135. 需授予短信发送权限且插入SIM卡才可成功发送短信,有预置短信内容,每次退出应用数据会清空,未添加存储功能,发送短信为默认卡发送。
14
15### 效果预览
16|新建联系人|首页|短信页|
17|-------------|-----------|------------|
18
19|![](screenshots/device/create_contact.png)| ![](screenshots/device/save_contact.png)| ![](screenshots/device/send_message.png)|
20
21
22### 相关权限
23
24发送短信权限:[ohos.permission.SEND_MESSAGES](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionsend_messages)
25
26设置通话状态权限:[ohos.permission.SET_TELEPHONY_STATE](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md#ohospermissionset_telephony_state)
27
28### 约束与限制
29
301. 本示例仅支持在标准系统上运行;
312. 本示例需要插入SIM卡,目前该功能仅支持部分机型;
323. 本示例仅支持API9版本SDK,版本号:3.2.10.6;
334. 本示例涉及使用系统接口:getSmscAddr(),需要手动替换[Full SDK](https://docs.openharmony.cn/pages/v3.2/zh-cn/release-notes/OpenHarmony-v3.2-beta4.md/)才能编译通过,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/);
345. 本示例需要使用DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100, built on November 3, 2022)才可编译运行;
356. 本示例所配置的权限ohos.permission.SEND_MESSAGESohos.permission.SET_TELEPHONY_STATEohos.permission.GET_TELEPHONY_STATE为system_basic级别(相关权限级别可通过[权限定义列表](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md)查看),需要手动配置对应级别的权限签名(具体操作可查看[自动化签名方案](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/security/hapsigntool-overview.md/))36