Skip to main content
Samsung Developer Program

Edge Single Plus Panels, Edge Single Panels, and Edge Feeds

You can create Edge Single Plus panel apps, Edge Single  panel apps, and Edge feed apps.  You can market your Edge apps, either individually or multiple Edge apps of the same type, to users via the Galaxy Apps store and other app stores.

This section presents programming used only when developing Edge Single Plus panel apps, Edge Single  panel apps, and Edge feed apps.  For programming used when developing all types of Edges apps, see Fundamental Edge Functionality.

 

Edge App Configuration File

The com.samsung.android.cocktail.provider XML  file configures fundamental aspects of the Edge panel or feed app (such as its label, description, preview image, category, update interval, and an Edge configuration activity).

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

Edge app metadata must or can include the following:

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 user 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.

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'.

updatePeriodMillis

Optional

How often (in 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, we recommend 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.

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.

 

The following example code shows how to specify an Edge app configuration file:

<?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>

 

Edge Panel or Feed Receivers

Your Edge app's APK AndroidManifest.xml  must specify an Edge broadcast receiver that refers to the configuration file for your type of Edge app.

Caution: All metadata strings values must specify a reference to the Edge app configuration file; they must not specify a string value. Always define your Edge app strings via a strings.xml file.  
 

The <receiver> tag 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 receiver.
    Note: This is the only broadcast that must be explicitly declared.
     
  • For Edge Single Plus panel apps, specify com.samsung.android.cocktail.v2.action.COCKTAIL_UPDATE
  • For Edge Single panel and Edge feed apps, specify com.samsung.android.cocktail.action.COCKTAIL_UPDATE
  • A <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 and filename to the file that contains Edge app metadata.
       

The following example code shows how to specify 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 following example code shows how to specify 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>

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 identify 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 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 one 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.

 

The following example code shows how to manage an Edge broadcast to periodically update Edge app 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) { 
        ...
    } 
}

 

  • Was this article helpful?