Skip to main content
Samsung Developer Program

Look Development, Initialization, and Slook Class

Look development architecture, requirements, and environment; and Look initialization and Slook class

Note:

  • S-Pen features SmartClip and PointerIcon were deprecated in Android 7.0 Nougat.

  • The S-Pen features in the Look SDK (AirButton, SmartClip, WritingBuddy) were deprecated in Android 7.0 Nougat.

  • The AirButton and the WritingBuddy features were deleted as of Look SDK version 1.4.0.

Look Development

The section describes the Look architecture, files, user device requirements, and IDE setup.

Architecture

The Look architecture consists of:

  • Applications: One or more applications that use Look
  • SLookSDK: Look UI components
  • Slook-support
  • View System: Android Framework View System

Look_Overview_Architecture.png

Components

Jar files:

  • look-v1.3.0.jar
  • sdk-v1.0.0.jar

 Imported packages:

  • com.samsung.android.sdk.look
  • com.samsung.android.sdk.SsdkUnsupportedException

User Device Requirements

The Look package uses a static Java library that depends on internal Android framework modules, which means that the Look package only runs on devices that support those modules. Some Samsung Smart Devices do not support Look. Look S-Pen requires that an S-Pen be used to access its features.

To support Look Edge and Look S-Pen, user devices must meet the following:

  • The device must have a Samsung implementation installed in the Android Framework’s View System.
    Note: If a user device does not have this implementation, Look Edge and S-Pen functions will not work on the device. However, no build errors or exceptions will occur.

  • To support Look Edge, the device must have a curved Edge screen on one side (Samsung Note Edge device) or on two sides (Samsung S7, S6 Plus, and S6 Edge devices).

  • To support Look S-Pen, the device must have a Samsung S-Pen (Samsung Note 1, Note 2, Note 3, Note 4, and Note Edge devices).

Setting Up the IDE

To develop applications for Samsung mobile devices, configure your Android development environment to meet the following requirements. If your development environment is already configured, you can skip this section.

To install Look for Eclipse:

Add the look-v1.3.0.jar and sdk-v1.0.0.jar files to the libs folder in Eclipse:

Look_Development_LibsFolder.png

Initializing Look 

Your app must initialize Look Edge and S-Pen so that your users can use Look Edge and S-Pen features (Edge Single Plus, Edge, and Feed Panels; the Edge Immersive Panel; and S-Pen AirButton, SmartClip, WritingBuddy, and PointerIcon). Initialization requires a specific permission in the manifest and integrating the Slook.initialize() method. 

Initialize Look by specifying the following permission in the AndroidManifest.xml file:

<uses-permission android:name= "com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY"/>

Caution: If the permission is not specified:

  • Android 4.4.2 (KitKat) and above: SecurityException is thrown, and your application will not work.
  • Prior to Android 4.4.2 (KitKat): There is no Exception, and the application works properly.

The Samsung Mobile SDK provides a base class (Slook) with an initialize() method for each Look package. Slook can run only on Samsung Smart devices; however, some Samsung Smart Device models do not support some Look packages. 

The Slook.initialize() method:

  • Initializes the Look package.
  • Checks if the device is a Samsung device.
  • Checks if the device supports the Look package and if necessary Look libraries are installed on the device. 

If the device does not support one or more Slook packages, an SsdkUnsupportedException exception is thrown, which your app must handle. The exception VENDOR_NOT_SUPPORTED indicates that the device is not a Samsung device and does not support any Look packages. The exception DEVICE_NOT_SUPPORTED indicates the device is a Samsung device that does not support or have necessary Look libraries for one or more Look features. For Samsung devices, your app can check whether or not the user's device supports a specific Look feature via SsdkUnsupportedException.getType().

For more details, see Slook Class API Structure.

The following example code shows how to initialize Look Edge and/or S-Pen and handling exceptions:

Slook slook = new Slook(); 
LinearLayout l = (LinearLayout) findViewById(R.id.information); 

try { 
    slook.initialize(this); 
} catch (SsdkUnsupportedException e) { 
    l.addView(createTextView(e.toString())); 
    return; 
}

Slook Class API Structure

This section introduces the Slook class API methods.  

For API details, see the online Look API Reference ( http://img-developer.samsung.com/onlinedocs/sms/look/index.html).

Slook_Class.png

Slook Class

Initializes Look Edge and S-Pen and gets fundamental Look SDK and user device support information.

Constructor  
Slook( ) Instantiates an Slook object to support the Look Edge and S-Pen operations and gets fundamental SDK and device support information.

 

Methods    
int getVersionCode() Returns the version code of the Look SDK package.
java.lang.String  getVersionName() Returns the name of the Look SDK package.

void

initialize(Context arg0 )

Initializes Look Edge and S-Pen using the specified context:

arg0 Name of the context that is to run Look Edge and S-Pen

Throws an SsdkUnsupportedException if the user's device is not a Samsung device or does not support all Look features:  

VENDOR_NOT_SUPPORTED The device is not a Samsung device and does not support any Look Edge or S-Pen features.
DEVICE_NOT_SUPPORTED The user's device is a Samsung device that does not support one or more Look Edge and/or S-Pen features.

boolean

isFeatureEnabled(int type)

Determines whether or not the user's Samsung device supports the specified Look feature: 

type Kind of Look Edge or S-Pen feature:
  COCKTAIL_PANEL Look Edge Single Plus, Edge, and Feed Panels
  COCKTAIL_BAR Look Edge Immersive Panel
  AIRBUTTON Look S-Pen AirButton 
  SMARTCLIP Look S-Pen SmartClip
  WRITINGBUDDY Look S-Pen WritingBuddy
  SPEN_HOVER_ICON Look S-Pen PointerIcon

Returns true when the user's Samsung device supports the specified feature or false otherwise.

 

  • Was this article helpful?