How to Change APP Name, Icon, and Configure Network Settings
When developing an APP, changing its name, icon, and configuring network access are common requirements. Follow these steps:
Changing APP Name
-
Open Project: Launch your project and locate the
module.json5
file, typically in theentry->src->main
directory. -
Modify Name: Find the
label
field under theabilities
node inmodule.json5
. Thevalue
attribute of this field is your APP name. Update thevalue
for all relevant pages. For example:
"abilities": [ { "label": { "value": "NewAppName" }, ... } ]
Restart APP: Save changes and restart the APP to see the new name.
Changing APP Icon
-
Locate Icon File: Find the
layered_image.json
file in your project, which defines the APP icon. -
Update Icon: In
layered_image.json
, replace or modify the icon path with your new icon's path. - Check Result: Save the file, recompile, and run the APP to view the new icon.
Configuring Network Access
-
Open module.json5: Access the
module.json5
file in theentry->src->main
folder. -
Add Network Permission: Include the following configuration to enable network access:
"module": { "reqPermissions": [ { "name": "ohos.permission.INTERNET" } ] }
Test Network Functionality: Save and run the APP to verify network access works properly.
These steps will help you modify APP name and icon, and configure network permissions. Feel free to leave comments for further discussion.
Top comments (0)