All Products
Search
Document Center

Mobile Platform as a Service:Configure a preset center booth

Last Updated:Jul 21, 2023

Special booth positions such as the middle cannot be configured through the mPaaS console. To create such booths, you need preset the booth on the client page through codes to control the booth page, position, and other attributes.

The following describes how to configure a preset booth situated in the middle by client coding.

Procedures

  1. In the project, create an app page that will be used for advertising and its corresponding category, such as AdvertisementBoothActivity. A preset booth will be configured in the middle of the page through the client code.

  2. Preset the CdpAdvertisementView parameter to the app page created in Step 1 by any of the following methods.

    • Preset the CdpAdvertisementView parameter through XML:

      <com.mpaas.cdp.CdpAdvertisementView
      android:id="@+id/pit_cdp_cav"
      android:layout_width="match_parent"
      android:layout_height="150px"
      android:layout_marginTop="800px"
      android:background="#66ccff"
      />
    • Add the CdpAdvertisementView parameter through Java:

      CdpAdvertisementView cdpView = new CdpAdvertisementView(context);
      parentView.addView(cdpView);
  3. Call the update API in the onResume() life cycle of the corresponding Activity to obtain other information about the booth from the server, such as booth height, display style, and content type.

     cdpView.updateSpaceCode("my_space_code");   //Replace my_space_code with booth ID
    Note

    After completing the corresponding booth configuration on the console, the booth information obtained from the server will be populated into the CdpAdvertisementView parameter.

  4. In the AndroidManifest file, add AdvertisementBoothActivity.

At this point, you have completed the configuration of a preset booth.

What to do next

After configuring the booth ID, booth page, booth position and other attributes on the client, you can create the corresponding booth on the console (the preset booth ID created on the console must be consistent with that on the client) for use in an activity. For details, see Create a client preset booth.