# Developing Android Device Apps

On the Android side, the developer needs to run an Android app (also known as a Mini Program in the documentation) Launcher), used to register the device, run a Mini Program to VOIP Calls and other operations.

# 1. to access WMPF And run the Mini Program

On the Android platform, the mini program video calling ability is implemented in the mini program. An Android app running on the device needs to pull up a small application developed by the developer to make and receive audio and video calls.

Prepare before completing the development3.1 Access to WeChat hardware platform, and after the device is registered, it is possible to obtain WMPF Required to run the productIdkeyVersiondeviceIdsignature And other hardware information.

Please refer to the[WMPF file](https://developers.weixin.qq.com/doc/oplatform /Miniprogram_Frame/quick-start.html)Do the following:

  • deploy WMPF Service APK
  • reference WMPF Sample code provided for integration in the application WMPF Client
  • call [activateDevice](https://developers.weixin.qq.com/doc/oplatform /Miniprogram_Frame/api/cli/device/activateDevice.html) Complete device activation

# 2. Equipment registration

Before initiating a call, the device needs to be registered. Please refer to theDevice Certification Documentscomplete RPMBD Deployment of services, SDK Steps for access and device registration.

Once the device is registered, it can be accessed before initiating a call by SDK of getDeviceToken Interface to get the device ticket, passed into the Mini Program as a call VOIP Plug-in to initiate the call VoipToken Use.

Note:

  • Used here. SN, must go through the WMPF of [addDevice](https://developers.weixin.qq.com/doc/oplatform /Miniprogram_Frame/api/backend/addDevice.html) Interface as the deviceId Registration, and with the WMPF [Device activation](https://developers.weixin.qq.com/doc/oplatform /Miniprogram_Frame/api/cli/boot/init.html) Used deviceId Consistent. Otherwise, subsequent calls cannot be initiated normally.
  • Use of Equipment Certification SDK The need for assurance rpmbd The service has been successfully run.

# 3. Running Mini Program

complete WMPF After installation and device activation, you can call [launchMiniProgram](https://developers.weixin.qq.com/doc/oplatform /Miniprogram_Frame/api/cli/miniprogram/launchMiniProgram.html) Start the specified Mini Program.

# 3.1 Android apps and Mini Programs communicate

After the Mini Program is started, the application can communicate with the Mini Program in the following ways

  • SimpleAndroid app -> Mini ProgramOne-way single this transfer parameters of the scene, you can directly start the Mini Program path Middle splicing query。
  • If the Android app wants to receive events from the Mini Program, needs two-way communication, or has a large amount of data, it can use the WMPF Provided[Communication channel(Invoke Channel)](https://developers.weixin.qq.com/doc/oplatform /Miniprogram_Frame/invoke-channel.html)

# 3.2 Run Development Version/Experience Mini Program

Using the development version/When debugging the experience version of the Mini Program, please refer to the following steps.

Note: You must scan the code to log in before you can download the development version normally/Experience version. Development version/After the experience version is updated, it is recommended to restart WMPF To be updated to the latest.

  1. Developer in Developer Tools Clickpreview, the development version of the Mini Program code package uploaded to the background. Can also be submitted to the experience version
  2. in WMPF Up call [Login](https://developers.weixin.qq.com/doc/oplatform /Miniprogram_Frame/api/cli/account/Login.html) Popup scan code login screen, by the developer tools login with the same micro signal scan code login
  3. WMPF [launchMiniProgram](https://developers.weixin.qq.com/doc/oplatform /Miniprogram_Frame/api/cli/miniprogram/launchMiniProgram.html) When specified appType For Development or Experience
  4. The development version has an expiration date, and the above steps need to be repeated after the expiration