Updating an Existing Application with the Android Skin

You can use the new Android skin to update an existing application. Below is a walkthrough that illustrates how to integrate the Android skin into the BasicPlaybackSampleApp.

  1. If you have not already done so, download the latest version of the Ooyala Mobile SDK for Android (available at Ooyala Downloads), and unzip OoyalaSkinSDK.zip. Clone the android-sample-apps repository by entering the following command:
    git clone https://github.com/ooyala/android-sample-apps.git
  2. Copy OoyalaSkinSDK.jar into the libs/ directory of your app.
  3. Modify your app gradle build file configuration to include OoyalaSDK, OoyalaSkinSDK, and React support, as shown in the following Gradle build file snippet:
    dependencies {
        ...
        compile files('libs/OoyalaSDK.jar')
        compile files('libs/OoyalaSkinSDK.jar')
        compile(name:'react-native', version:'0.33.0', ext:'aar')
        ...
    }                        
                        
  4. You must specify either an AppCompat theme or an extension of one. In AndroidManifest.xml, specified the following android:theme:
         <application
             android:allowBackup="true"
             android:icon="@drawable/ic_launcher"
             android:label="@string/app_name"
             android:theme="@style/Theme.AppCompat">
                        
    Note: You can use any theme that extends Theme.AppCompat, such as Theme.AppCompat.Light.
  5. To allow Android to use 32-bit libraries on 64-bit devices, add the following property into gradle.properties:
    android.useDeprecatedNdk=true
  6. Put fonts, index.android.jsbundle, Localization Files (en.json, zh.json, etc.), and skin.json into src/main/assets.
  7. Include OoyalaSkinLayout to layout.xml of the activity that displays a player:
    <com.ooyala.android.ooyalaskinsdk.OoyalaSkinLayout
        android:id="@+id/ooyalaSkin"
        ...
    />                        
                        
  8. Modify your activity to use the new OoyalaSkinLayout:
    public void onCreate(Bundle savedInstanceState) {
        ...
    
        setContentView(R.layout.layout.xml);
    
        EMBED = getIntent().getExtras().getString("embed_code");
    
        //Initialize the player
        OoyalaSkinLayout skinLayout = (OoyalaSkinLayout)findViewById(R.id.ooyalaPlayer);
        PlayerDomain domain = new PlayerDomain(DOMAIN);
        Options options = new Options.Builder()
                  .setShowPromoImage(false)
                  .build();
        player = new OoyalaPlayer(PCODE, domain, options);
        
        //Create the SkinOptions, and setup the Skin
        SkinOptions skinOptions =  new SkinOptions.Builder().build();
        playerLayoutController =  new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions);
        ...
    
    }                    

To summarize, the following is the list of requirements for Ooyala Skin SDK to work in your application:

  • OoyalaSDK.jar and OoyalaSkinSDK.jar must be imported to your application.
  • Ooyala Skin SDK
    • SDK version in the skin package's VERSION file should match the VERSION file in the Ooyala SDK.
  • Fonts
    • Should be added to the assets folder.
  • Localization Files (en.json, zh.json, etc.), skin-config.json, and index.android.jsbundle should be added to the assets folder.

Was this article helpful?