Samsung SG - Samsung Mobile SDK

Preview:

DESCRIPTION

SG Android Developers Meetup - October presentation by Manikantan Krishnamurthy

Citation preview

Manikantan Krishnamurthy

Manikantan.k@samsung.com@manikantan_k

Samsung Mobile SDK

SAMSUNG DEVELOPER

SM SDK WORKSHOP

http://developer.samsung.com

SAMSUNG SMART APP CHALLENGE 2013

SM SDK WORKSHOP

www.smartappchallenge.com

SAMSUNG MOBILE SDK

SM SDK WORKSHOP

http://developer.samsung.com/samsung-mobile-sdk

Type 1- Pen, ImageFilter, Chord, Visual View.

- No special requirements other than API Level.

Type 2- MultiWindow, Gesture, Motion, MediaControl, Look, Audio.

- Require hardware or software support enabled on device.

- Eg Air Gestures are available only on devices with the Gesture Sensor

API 14+

Pen SDK

Precision + Pressure sensitivity

THE NEED FOR A NEW INPUT METHOD

S PEN SDK WORKSHOP

CapacitiveTouch

Pressure Sensitive Pen

S PEN SDK WORKSHOP

Precise and quick responseSupports pen pressure

1

Advantages of S Pen

No power consumptionLightweight hardware

2

Side button, pen hovering A new UX

3

WHAT IS THE S PENA new type of input device available on Note range of devices.Note 1, Note 2, Note 3, Note 8, Note 10.1, Note 10.1 (2014 ed)

S PEN SDK WORKSHOP

Can replace existing touch input methods, more precision.

Activation,Coordinates,

Pressure

TouchY : 0.0X : 0.0X : 130.0

PenY : 150.36Y : 250.36Y : 350.36Y : 450.36Y : 550.36Y : 650.36Y : 750.36Y : 850.36Y : 960.20Y : 1060.20Y : 1160.20X : 590.0 Y : 150.36Y : 250.36Y : 350.36Y : 450.36Y : 550.36Y : 650.36Y : 750.36Y : 850.36Y : 960.20Y : 1060.20Y : 1160.20

S PEN SDK WORKSHOP

Recognize pen events without contact

Screen

No contact

HoveringPen Icon

S PEN SDK WORKSHOP

Recognize the side button with or without contact

Side Button Recognition

Call a Function

Hovering

S PEN SDK WORKSHOP

Act upon the gestures of the S Pen

-Call the toolbar using the side button

-Information preview, help

-Define and use gestures

-Change hover pointer

S PEN SDK WORKSHOP

Recognize the side button with or without contact

-Content moving and resizing

-Content scrolling (page, listview)

-Full text descriptions

-Rollover effects

Keep aspect ratioPrev Movie Play Next MovieVideo Pop

Volume control. Now at level 0

S PEN SDK WORKSHOP

SOME USE CASES

B2BEducationSNS

GameMemo &Planner

Graphics

S PEN SDK WORKSHOP

SPENSURFACEVIEW THE CANVAS

Including S Pen Library

1. Copy penXXX.jar

2. Copy sdkXXX.jar into libs

3. Build Target latest Android API

S PEN SDK WORKSHOP

HOW TO: ADD THE CANVAS

import com.samsung.android.sdk.pen.*;

Spen spenPackage = new Spen(); //New instancespenPackage.initialize(this); // Init package

//SpenSurfaceView is like a surface on which Notes are drawnmSpenSurfaceView = new SpenSurfaceView (mContext);spenViewLayout.addView(mSpenSurfaceView);

//SpenNoteDoc is like a notebook and SPenPageDoc are individual pages in the NotebookmSpenNoteDoc = new SpenNoteDoc (mContext, width, rect.height );SpenPageDoc SpenPageDoc = mSpenNoteDoc.appendPage(); mSpenPageDoc.setBackgroundColor(0xFFD6E6F5);mSpenPageDoc.clearHistory();

mSpenSurfaceView.setPageDoc(mSpenPageDoc, true);

S PEN SDK WORKSHOP

ERASER, PEN MODES & HISTORY MGMT

// Pen ModespenSurfaceView. setToolTypeAction(SpenSettingViewInterface.TOOL_SPEN, SpenSurfaceView.ACTION_STROKE);

// Eraser ModespenSurfaceView. setToolTypeAction(SpenSettingViewInterface.TOOL_SPEN, SpenSurfaceView.ACTION_ERASER);

// Undo and Redoif(spenPageDoc.isUndoable ()) {

spenSurfaceView.updateUndo (spenPageDoc.undo () );};

// Pen settingsSpenSettingPenInfo penInfo = new SpenSettingPenInfo();penInfo.color = Color.BLUE; //size , pen type are other optionsspenSurfaceView.setPenSettingInfo(penInfo);

S PEN SDK WORKSHOP

OTHER S PEN EVENTS/ACTIONS

SpenPenDetachmentListenerto detect attachment and removal of S Pen, while your app is active.

SpenHoverListenerto detect hovering, side-button press and release.

SpenSettingPenLayout SpenSettingEraserLayout

S PEN SDK WORKSHOP

INSERT IMAGE INTO CANVAS

SpenObjectImage imgObj = new SpenObjectImage ();Bitmap imageBitmap = BitmapFactory.decodeResource(

getResources(), R.drawable.ic_launcher);imgObj.setImage(imageBitmap);

imgObj.setRect(imageBoundingRect, true);spenPageDoc.appendObject(imgObj);spenSurfaceView.update();

INSERT TEXTBOX INTO CANVAS

SpenObjectTextBox

Stroke is a collection of points, pressure values, timestamp.

S PEN SDK WORKSHOP

SIGNATURE RECOGNITION

SpenSignatureVerification

import com.samsung.android.sdk.pen.recognition

Simi larly Text , Shape, Equations can be recognized

getRegisteredCount() no. of signs registers

register() - Device Info & Type cast for devices

request() Recognition result after verification

unregisterAll() Remove all signs registered

setVerificationLevel() Set verification strictness

API 17+

Chord SDK

2. Main Features

CHORD - INTRODUCTIONChord is an easy to use, local networking library to send / receive messages with nearby devices.

Low-latency , P2P , 1-to-Many networking.

CHORD

Platform

Network Stack (TCP, UDP, Wifi, Wifi Direct etc)

Discovery Protocols

Channel Manager

Messaging & File transfer

ZeroMQ Security

Chord API

2. Main Features

CHORD - INTRODUCTIONEvery node is part of public Chord channel.

Only nodes using your app, can connect to that channel.

CHORD

2. Main Features

CHORD

Schord init methods

SchordManager

.start()

.stop()

.joinChannel()

.leaveChannel()

SchordManager.StatusListener

- Fires events upon start and stop.

SchordChannel.StatusListener

- Fires events upon joining or leaving channel.

2. Main Features

CHORD

SchordChannel

.sendData()

.sendDataToAll()

.sendFile()

.acceptFile()

.rejectFile()

SchordChannel.StatusListener

- Fires events upon incoming or outgoing data.

API 14+

Media Control SDK

2. Main Features

MEDIA CONTROL - INTRODUCTIONCreate apps that share music, videos and photos between network devices.

MEDIA CONTROL

Tools for testinghttp://software.intel.com/en-us/articles/intel-software-for-upnp-technology-download-tools

2. Main Features

MEDIA CONTROLSmcDeviceFinder for device discovery

SmcDevice - Device Info & Type cast for devices

SmcItem The content being streamed to viewer

SmcAvPlayer Streams audio/video

SmcImageViewer Shows images on viewer

MEDIA CONTROL

2. Main Features

MEDIA CONTROL VIDEO

MEDIA CONTROL

DeviceFinderShow

ContentControl

smcLib = new Smc( ) ;smcLib . in it ia l ize (this) ;

SmcDeviceFinder.start().rescan().getDeviceList( int DeviceType) //shows DLNA complaint devices, Windows Media Player 11+

2. Main Features

MEDIA CONTROL VIDEO

MEDIA CONTROL

DeviceFinderShow

ContentControl

mAVPlayer = (SmcAVPlayer) mDevices .get(0) ;

SmcItem item = new SmcItem(new SmcItem.LocalContent(filePath, mimetype) );

mAVPlayer.play( SmcItem , SmcAvPlayer.PlayInfo );

SmcAvPlayer.EventListener helps to monitor different states of the contentlike STATE_STOPPED, STATE_BUFFERING, STATE_PLAYING etc

Manikantan.k@samsung.com@manikantan_k

Facebook.com/samsungdevs

Recommended