All Products
Search
Document Center

Configure preset booth

Last Updated: Sep 01, 2021

Configure preset booth means to control the display of the booth (for example, the page where the booth is located and the location of the booth) through the client-side code, and at the same time obtaining other booth information from the server through calling API, such as booth height, display style, content type, etc.

About this task

You can preset the CdpAdvertisementView booth parameters through XML to the layout.xml file on the interface where the booth is located in the App, or add the parameters to the layout.xml file with Java code. Then, calling the updated interface during the life cycle of onResume() in Activity.

Note: The booth information obtained from the server will be filled in the CdpAdvertisementView parameter.
If you are a new user of the Mobile Content Delivery Platform, we recommend that you dynamically configure the Android page of the advertising booth directly on the console (server). For more server configuration information, please refer to Create a booth.

Procedures

  1. Preset CdpAdvertisementView in the layout by one of the following methods.

    • Preset CdpAdvertisementView parameters via XML:

      1. <com.mpaas.cdp.CdpAdvertisementView
      2. android:id="@+id/pit_cdp_cav"
      3. android:layout_width="match_parent"
      4. android:layout_height="wrap_content" />
    • Add the CdpAdvertisementView parameter with Java code:

      1. CdpAdvertisementView cdpView = new CdpAdvertisementView(context);
      2. parentView.addView(cdpView);
  2. Call the update interface.

    1. cdpView.updateSpaceCode("my_space_code");