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.
- 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.
CdpAdvertisementViewparameter to the app page created in Step 1 by any of the following methods.
- Preset the
CdpAdvertisementViewparameter through XML:
CdpAdvertisementViewparameter through Java:
CdpAdvertisementView cdpView = new CdpAdvertisementView(context);
- Preset the
- 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.
Note: After completing the corresponding booth configuration on the console, the booth information obtained from the server will be populated into the
cdpView.updateSpaceCode("my_space_code"); //Replace my_space_code with booth ID
At this point, you have completed the configuration of a preset booth.
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.