The previous article covered updates to the VirtualView tool, but we need a more convenient development experience, such as a live preview. In Cat guest, we cooperate with template platform, integrated scan code preview ability. For the development phase, we also needed a one-stop service from template compilation to preview, so we packaged such a gadget.

Tools are submitted on Github

Introduction to the

This script is based on the buildTemplate.sh script, which integrates the “compile” – “upload” – “refresh” process. The goal is to refresh the preview automatically after the template is written.

Depend on the environment

  • python
  • adb
  • Java

Method of use

python buildAndPreview.py VH2Layout

The parameter is the name of the template to be modified and previewed, as in templatelist.properties.

previewconfig.confConfiguration parameters

  • Push the compiled.out file to the path stored on the phone
[path]
target = /sdcard/com.tmall.wireless.virtualviewdemo/virtualview/
Copy the code
  • Preview the preview screen of the app
[preview]
activity = com.tmall.wireless.virtualviewdemo.debug/com.tmall.wireless.virtualviewdemo.PreviewActivity
Copy the code

The default values above are configured in the VirtualView-Android demo. You can migrate the demo code to your own app environment for preview.

Default configuration file:

Preview the client

The default demo is based on VirtualView-Android. If you have custom controls, you need to modify the preview app to add custom component registration logic. Therefore, you are advised to configure your own preview environment by referring to Demo. (Make sure your phone has SD card reading permission)

demo