Skip to main content

Ready to market your stellar app?

Samsung Developer Program is your gateway to app monetization success.

Learn More

Samsung Developer Program

Implementing Edge Single Panels, Single Plus Panels, and Feeds

You can create Edge Single panel apps, Edge Single Plus panel apps, and Edge Feed apps and distribute them to users. 

NOTE:  This section does not apply to Edge Immersive panel apps, which is covered in the Implementing an Edge Immersive Panel section. 

 

Requirements

To implement each type of Edge panel or feed, the following requirements must be met:

  • Edge Single panels:
    • Your Edge app must specify API level 21 as the minSdkVersion and targetSdkVersion.
    • Your Edge app receiver's intent filter must specify android:name= "com.samsung.android.cocktail.action.COCKTAIL_UPDATE"
    • User devices must be running Android 5.0 (Lollipop) or above.  
       
  • Edge Single Plus panels:
    • Your Edge app must specify API level 23 as the minSdkVersion and targetSdkVersion.
    • Your Edge app receiver's intent filter must specify android:name= "com.samsung.android.cocktail.v2.action.COCKTAIL_UPDATE"
    • User devices must be running Android 6.0 (Marshmallow) or above.  
       
  • Edge feeds:
    • Your Edge app receiver's intent filter must specify android:name= "com.samsung.android.cocktail.action.COCKTAIL_UPDATE"
    • Your Edge app must specify API level 21 as the minSdkVersion and targetSdkVersion.
    • Your Edge app essential metadata must specify category=‘feeds’
    • A black background is recommended in order to match the inactive display screen.
    • User devices must be running Android 5.0 (Lollipop) or above.  


NOTE:  For all types of Edge screens, it is recommended to a have a single depth (default setting).

Edge Panel or Feed Receivers  

Your Edge panel /feed app must specify an Edge broadcast receiver in the AndroidManifest.xml file that specifies: the type of Edge panel / feed, and a reference to essential Edge panel / feed metadata.

The <receiver> element must specify:

  • android:name with the name of the SlookCocktailProvider object associated with the Edge panel / feed.
  • <intent-filter> element with an <action> element  containing the android:name attribute that specifies the type of Edge panel / feed, and that  the SlookCocktailProvider object accepts the type of Edge update broadcasts to be accepted and processed by the Edge panel recevier:
    NOTE: This is the only broadcast that must be explicitly declared
  • For Edge Single panels and Edge feeds, specify com.samsung.android.cocktail.action.COCKTAIL_UPDATE
  • For Edge Single Plus panels, specify com.samsung.android.cocktail.v2.action.COCKTAIL_UPDATE
  • <meta-data> element that specifies:
    • android:name with the metadata name that identifies the data as the CocktailProviderInfo descriptor.
      NOTE:  Always specify android:name="com.samsung.android.cocktail.provider"
    • android:resource with the path / filename to the file that contains Edge panel / feed metadata.
Example Code: Specifying a Receiver for an Edge Single Panel or Edge Feed
/AndroidManifest.xml 

<receiver android:name=".EdgeSingleProvider" > 
    <intent-filter> 
        <action android:name= 
            "com.samsung.android.cocktail.action.COCKTAIL_UPDATE" /> 
    </intent-filter> 
    <meta-data 
        android:name="com.samsung.android.cocktail.provider" 
        android:resource="@xml/edg_single"> 
</receiver>
Example Code: Specifying a Receiver for an Edge Single Plus Panel
/AndroidManifest.xml 

<receiver android:name=".EdgeSinglePlusProvider" > 
    <intent-filter> 
        <action android:name= 
            "com.samsung.android.cocktail.v2.action.COCKTAIL_UPDATE" /> 
    </intent-filter> 
    <meta-data 
        android:name="com.samsung.android.cocktail.provider" 
        android:resource="@xml/edge_single_plus"> 
</receiver>

 

The com.samsung.android.cocktail.provider XML resource file referenced by your Edge app receiver's metadata defines basic aspects of the Edge panel / feed (such as its label, description, preview image, category, update interval, and an Edge configuration activity).

The metadata XML resource file must specify a single <cocktail-provider> element with all appropriate metadata.  The file must be saved in the project resource directory res/xml/ 

CAUTION:  All metadata strings values must specify a reference to a file containing the metadata.  Metadata strings values CANNOT be directly specified in a strings value. 

Edge panel / feed metadata can include:

label

Required

Reference to a file containing the descriptive name of the Edge panel / feed

This name is displayed in the Device Settings > Edge Screens > Manage Panel screen when the use taps the Edge panel / feed.

description Required

Reference to a file containing a brief explanation of the Edge panel / feed

previewImage Required Reference to the PNG file containing the image (72x325 pixels for 640 dpi displays, 82x371 pixels for 560 dpi displays) of the Edge panel / feed to be displayed in the in the Device Settings > Edge Screens > Manage Panel screen.  

updatePeriodMillis

Optional

How often (milliseconds) the Edge Framework will send your Edge app a request to refresh Edge panel / feed item content

The actual refresh broadcast is not guaranteed to occur within the specified intervals.  To conserve battery power, it is recommended that updatePeriodMillis is greater than 1 800 000  (30 minutes).  

permitVisibilityChanged

Optional

Whether or not the Edge Framework is to notify your Edge app (via onVisibilityChange()) when the display status (shown or hidden) of your app's Edge panel / feed changes, as a result of user action: 

true  onVisibilityChanged() is to be called when the Edge panel / feed display status changes.
false onVisibilityChange() is not to be called when the display status changes.

configure

Conditionally Required

When providing users with the configuration panel, name of the configuration activity that specifies your Edge panel / feed configuration that is user-configurable

category

Conditionally Required

For Edge feeds ONLY, your Edge feed app must specify category: 'feeds'

cocktailWidth

Optional

For Edge Single Plus panels ONLY, the width of the item content area (pixels, maximum: 550)

When not specified, the Edge item content area will be single-width (71 pixels wide on 640 dpi displays, 82 pixels on 560 dpi displays).
NOTE:  Edge Single Plus panels cover the entire display screen and blur the main activity screen displayed below the Edge panel app title area and information area.

launchOnClick

Optional

For Edge Single Plus panels ONLY, specifies the action to be initiated (such as launching an activity) when the user taps the Edge panel's app title area

 

Example Code:  Specifying Edge Panel / Feed Metadata
<?xml version="1.0" encoding="utf-8"?> 
<cocktail-provider xmlns:android=http://schemas.android.com/apk/res/android 
    label="@string/edge_name" 
    decription="@string/edge_description" 
    previewImage="@drawable/edge_preview" 
    updatePeriodMills="1800000" 
    permitVisibilityChanged="true|false" 
    configure="com.example.edge.EdgeConfigure"
    category="feeds" 
    cocktailWidth="550" 
    launchOnClick="com.example.edge.MainActivity">
</ cocktail-provider>

 

 

Managing Edge Broadcasts

Your Edge app can extend the Android BroadcastReceiver class as a convenience class in order to manage Edge broadcasts that call the following  SlookCocktailProvider methods:

Edge Broadcast Method Called Purpose

Every broadcast

onReceive()

The parameters identify the context of the Edge panel / feed receiver and the intent of the received Edge broadcast.

Override when your app wants to specify its own processing to be executed after every broadcast.

Edge panel / feed became available

onEnabled()

The parameter identifies the context of the Edge panel / feed receiver. 

Override when your app wants to specify its own processing to be executed when the user makes the Edge panel / feed available. 

Edge panel / feed display status changed

onVisiblityChange()

The parameters identifies the context of the Edge panel / feed receiver, the ID of the Edge panel / feed, and its current display status. 

Override when your app wants to specify its own processing to be executed when the Edge panel / feed display status changes (hidden-to-shown, and/or shown-to-hidden). 

Edge panel / feed item content may need periodic refreshing

onUpdate()

The parameter identifies the context of the Edge panel / feed receiver, the IDs of all items in the Edge panel / feed, and its current display status.  

Override when your app wants to specify its own processing to be executed to periodically refresh the content of 1 or more items in the Edge panel / feed. 

Edge panel / feed became unavailable

onDisabled()

The parameter identifies the context of the Edge panel / feed receiver. 

Override when your app wants to specify its own processing to be executed when the user makes the Edge panel / feed unavailable.

 

For details, see the Edge SlookCocktailProvider API class section.

 

Example Code: Managing an Edge Broadcast to Periodically Update Panel / Feed Item Content
package com.example.edgescreen.provider; 

import com.samsung.android.sdk.look.cocktailbar.SlookCocktailManager; 
import com.samsung.android.sdk.look.cocktailbar.SlookCocktailProvider;
...

public class CocktailSampleProvider extends SlookCocktailProvider { 
    @Override 
    public void onUpdate(Context context, SlookCocktailManager 
        cocktailBarManager, int[] cocktailIds) { 
        ...
    } 
}


 

Edge Panel or Feed Layouts and Item Updating

Your Edge app must specify a layout for your Edge screen in XML and save it in the project directory res/layout/ 

Creating an Edge panel / feed layout is similar to using Android layouts. However, Edge layouts are based on RemoteViews, which do not support all Android layout classes. Edge RemoteView objects support the following layout classes:

  • FrameLayout, LinearLayout, RelativeLayout, GridLayout
  • Button, ImageButton
  • ImageView, ProgressBar, TextView, ViewFlipper, ListView

For details, see Android RemoteViews.

Each item in an Edge panel or feed is assigned a unique ID.  Your app can instruct Edge to refresh any item's content via its ID, either in response to an Edge update broadcast for periodic refreshing of item content, when an Edge panel or feed is enabled or its visibility is changed to displayed, for your app's own purposes, or when your app's user initiates updating content on demand (when enabled by your app).

 

Example Code: Defining a Layout for an Edge Panel or Feed and Updating its Item Content

RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.edge_panel); 
setPendingIntent(context, rv); 
for (int i = 0; i < cocktailIds.length; i++) { 
    cocktailBarManager.updateCocktail(cocktailIds[i], rv);
    ...
}

 

  • Was this article helpful?