All Products
Search
Document Center

Mobile Platform as a Service:CubeEngine

Last Updated:Nov 21, 2025

Introduction

This is about the core class of the card engine.

Methods

createCard

/**
 * Creates a single card.
 * @param config The card configuration parameters.
 * @param callback The callback.
 */
public void createCard(final CubeCardConfig config, final CCardCallback callback)

createCards

/**
 * Creates cards in a batch.
 * @param configs The batch configuration.
 * @param callback The callback. The callback is invoked once for each card result.
 */
public void createCards(List<CubeCardConfig> configs, final CCardCallback callback)

createView

/**
 * Creates a rendering view.
 * @return The Cube rendering container view.
 */
public CubeView createView(Context context)

setCustomUnit

/**
 * Sets a custom unit.
 * @param unitName The name of the unit, such as sip.
 * @param unitRadio The unit ratio, such as 1.5.
 */
public void setCustomUnit(String unitName, float unitRadio)

registerModule

/**
 * Registers a custom module.
 * @param models The key is the module name, such as animation, and the value is the class name, such as CKAnitmationModule.
 * @param options
 */
public void registerModule(Collection<CubeModuleModel> models, Bundle options)

registerWidgets

/**
 * Registers a group of custom extension widgets.
 * @param widgets The information about the extension widgets.
 */
public void registerWidgets(Collection<CubeWidgetInfo> widgets)

sendEvent

/**
 * Sends a custom event from native to JavaScript.
 * @param componentData The component data. This is the `data` input parameter used when you create a component in `onCreateView` of `CCardWidget`. Pass through this parameter.
 * @param eventName The name of the custom event.
 * @param eventParams The parameters of the custom event. 
 */
public void sendEvent(Map<String, Object> componentData, String eventName, @Nullable Map<String, Object> eventParams)

destroy

/**
 * Destroys the card instance.
 */
private void destroy()