All Products
Search
Document Center

Mobile Platform as a Service:Preset Cards

Last Updated:Nov 24, 2025

Download card resources

Method 1: Download the card file from the console. Click Download bin file. The downloaded file is a .zip file.

Method 2: Package the dist/main.zip file from your local card project.

Name the resource

  1. Copy the downloaded file to resource directory.

  2. Rename the downloaded file to Card ID@Card Version. For example, main@1_0_0_0.zip.

    image.png

    Note

    In the future, the console will directly provide fully named zip packages, eliminating the need for users to manually modify the names; users can simply add them to assets.

Preset resources

Android

  1. Set the properties of the CubeEngineConfig card engine class.

    /**
    * The path to the local resource package that stores the templates.
    *
    * @param resourcePath - Sets the resource file path.
    */
    public void setResourcePath(String resourcePath) {
                    this.resourcePath = resourcePath;
    }
  2. Set the path to the local Ant Cube Card assets.

    // Purge card data.
    CubeService.instance().destroyEngine();
    CubeEngineConfig config = new CubeEngineConfig();
    // Set the path.
    config.setResourcePath("The path where your resources are located");
    CubeService.instance().initEngine(config, MainApplication.getApplication());
  3. Place the .zip package in the specified path within assets directory.

iOS

  1. Add the downloaded file to the Bundle.

    Create a new Bundle file. Compress the downloaded .bin file into a .zip package and name it Card ID@Card Version. For example, main1@1_0_0_0.zip. The card requires data from a JSON file. You can either use a built-in file or dynamically request the data by calling an API. Choose the data source method based on your needs.

    image.png

  2. Import the Bundle into the project and pass the Bundle path when initialize the engine.

    - (void)initEngine {
        // The Bundle path for the local resource template.
        NSString *bundlePath = [NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] resourcePath], @"MPCubeBundle.bundle"];
        CubeEngineConfig *config = [[CubeEngineConfig alloc] init];
        [config setBundlePath:bundlePath];
        [[CubeService sharedInstance] initWithConfig:config];
    }