开发人员控制台
感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

Example Receipe Configuration for JSON Roku Feed

This example shows a recipe configuration for a feed that conforms to the required MRSS elements in a Roku feed.

Feed (xmlfeed2_CategoriesRecipe.json)

https://s3-us-west-1.amazonaws.com/devportal-reference-docs/fire-app-builder/feeds/feed2.xml

Category recipe:

{
  "cooker": "DynamicParser",
  "format": "xml",
  "model": "com.amazon.android.model.content.ContentContainer",
  "translator": "ContentContainerTranslator",
  "modelType": "array",
  "query": "//*[name()='media:category']/text()",
  "queryResultType": "[]$",
  "matchList": [
    "/StringKey@mTitle"
  ],
  "keyDataType": "/StringKey@keyDataPath"
}

Contents recipe (xmlfeed2_ContentsRecipe.json):

{
  "cooker": "DynamicParser",
  "format": "xml",
  "model": "com.amazon.android.model.content.Content",
  "translator": "ContentTranslator",
  "modelType": "array",
  "query": "//item[*[name()='media:category']='$$par0$$']",
  "matchList": [
    "media:title/#text@mTitle",
    "guid/#text@mId",
    "media:description/#text@mDescription",
    "media:content/#attributes/url@mUrl",
    "media:thumbnail/#attributes/url@mCardImageUrl",
    "media:thumbnail/#attributes/url@mBackgroundImageUrl"
  ]
}

BasicFileBasedUrlGeneratorConfig.json:

{
  "url_file": "urlFile_xmlfeed2.json"
}

urlFile_xmlfeed2.json

{
  "urls": [
    "https://s3-us-west-1.amazonaws.com/devportal-reference-docs/fire-app-builder/feeds/feed2.xml"
  ]
}

Navigator.java

...
public static final String NAVIGATOR_FILE = "Navigator_xmlfeed2.json";
...

Navigator_xmlfeed2.json

{
  "config": {
    "showRelatedContent": true,
    "useCategoryAsDefaultRelatedContent": true,
    "searchAlgo": "basic",
    "enableCEA608": false,
    "enableRecentRow": true,
    "maxNumberOfRecentItems": 5
  },
  "branding": {
    "globalTheme": "AppTheme",
    "lightFont" : "Roboto Light",
    "boldFont" : "Roboto Bold",
    "regularFont" : "Roboto Regular"
  },
  "globalRecipes": [
    {
      "categories": {
        "dataLoader": "recipes/xmlfeed2_DataLoaderRecipe1.json",
        "dynamicParser": "recipes/xmlfeed2_CategoriesRecipe.json"
      },
      "contents": {
        "dataLoader": "recipes/xmlfeed2_DataLoaderRecipe1.json",
        "dynamicParser": "recipes/xmlfeed2_ContentsRecipe.json"
      }
    }
  ],
  "graph": {
    "com.amazon.android.tv.tenfoot.ui.activities.SplashActivity": {
      "verifyScreenAccess": false,
      "verifyNetworkConnection": true,
      "onAction": "CONTENT_SPLASH_SCREEN"
    },
    "com.amazon.android.tv.tenfoot.ui.activities.ContentBrowseActivity": {
      "verifyScreenAccess": false,
      "verifyNetworkConnection": true,
      "onAction": "CONTENT_HOME_SCREEN"
    },
    "com.amazon.android.tv.tenfoot.ui.activities.VerticalContentGridActivity": {
      "verifyScreenAccess": false,
      "verifyNetworkConnection": true,
      "onAction": "CONTENT_SUBMENU_SCREEN"
    },
    "com.amazon.android.tv.tenfoot.ui.activities.ContentDetailsActivity": {
      "verifyScreenAccess": false,
      "verifyNetworkConnection": true,
      "onAction": "CONTENT_DETAILS_SCREEN"
    },
    "com.amazon.android.tv.tenfoot.ui.activities.ContentSearchActivity": {
      "verifyScreenAccess": false,
      "verifyNetworkConnection": true,
      "onAction": "CONTENT_SEARCH_SCREEN"
    },
    "com.amazon.android.uamp.ui.PlaybackActivity": {
      "verifyScreenAccess": false,
      "verifyNetworkConnection": true,
      "onAction": "CONTENT_RENDERER_SCREEN"
    }
  }
}

xmlfeed2_DataLoaderRecipe2.json

{
  "task": "load_data",
  "url_generator": {
    "url_index": "0"
  }
}

Last updated: Aug 03, 2018