HarmonyOS's Data Ability is used to provide an interface for operation data, but cannot provide file-related operations.
If a developer wants to develop a file background download function, there needs to be a Page Ability to provide UI pages, and a ServiceAbility to provide a background file download function. If you want to perform some operations in the Service Ability after connecting to the Service Ability in the Page Ability, you need to implement the onConnect() method in the Service Ability.
The application package names of the application projects created by JavaSaript and the applications compiled by the Java projects are HAR (HarmonyOS Ability Resources) and HAP (HarmonyOS Ability Package), respectively.
A user grants permission X to application A of a certain device, and on the device, application A persists the state of this permission grant and can call all interfaces controlled by permission X at any time.