All Products
Search
Document Center

Mobile Platform as a Service:Android FAQ

Last Updated:Jan 26, 2026

This topic answers common questions about integrating with Android and provides solutions.

What is the difference between handleEvent and interceptEvent for a custom JavaScript API?

Answer: To listen for events that the container handles, add the custom JavaScript API to handleEvent and return true. Returning true stops the event from propagating. Returning false allows the event to propagate to other plugins. To listen for other container events, add the custom JavaScript API to interceptEvent.

For a custom JavaScript API, why must an event be added in onPrepare if it has already been added?

Answer: When you create a custom JavaScript API, you add an event using config.setEvents("event");. However, container plugins use lazy loading. They load only when a page is created. The external config.setEvents injects the names of the events to listen for. The corresponding plugin object is not instantiated until a JavaScript (JS) call is made. Event dispatch for the instantiated plugin uses the events defined within the plugin's onPrepare method. Therefore, ensure the events in config.setEvents("event") match the events in the internal onPrepare method.

What are the differences among page, session, and service for custom JavaScript API plugin registration?

Answer: A page corresponds to a WebView. A session corresponds to an App object of an mPaaS application. A service is a global singleton.

  • If you register the plugin at the page level, a new plugin instance is created every time a WebView is created. The plugin's onRelease method is called when the WebView is destroyed.

  • If you register the plugin at the session level, a new plugin is created every time an App object is created.

  • If you register the plugin at the service level, the plugin is created only once. This happens the first time the container is opened.

Does signature verification validate the source of the offline package or perform an integrity check?

Answer: On the offline package publishing platform, if you configure a private key, the platform includes signature information in the distributed AMR file. This signature is the ciphertext created by encrypting the offline package's hash value with the private key. During signature verification, the public key pre-configured in your project is used to verify the signature. This process decrypts the ciphertext to retrieve the hash value. Then, it compares this hash value with a locally calculated hash of the offline package. A match confirms the signature. This process ensures both the content integrity and the correct source of the offline package.

What causes the progress bar to remain visible when an offline package is opened?

Answer: This can happen if the offline resources fail to load. The page then falls back to online mode. In fallback mode, the H5 container forces the progress bar to be visible. You cannot hide the progress bar by setting the SHOW_PROGRESS startup parameter.