Top Banner
Mani kantan Krishnamurthy [email protected] @manikantan_k Samsung Mobile SDK
31

Androidmeetup sg

Nov 01, 2014

Download

Technology

SGAndroidDevs

Presentation at October SG Android Developers Meetup by Manikantan Krishnamurthy, Samsung
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Androidmeetup sg

Manikantan Krishnamurthy

[email protected]@manikantan_k

Samsung Mobile SDK

Page 2: Androidmeetup sg

SAMSUNG DEVELOPER

SM SDK WORKSHOP

http://developer.samsung.com

Page 3: Androidmeetup sg

SAMSUNG SMART APP CHALLENGE 2013

SM SDK WORKSHOP

www.smartappchallenge.com

Page 4: Androidmeetup sg

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

Page 6: Androidmeetup sg

API 14+

Pen SDK

Page 7: Androidmeetup sg

Precision + Pressure sensitivity

THE NEED FOR A NEW INPUT METHOD

S PEN SDK WORKSHOP

CapacitiveTouch

Pressure Sensitive Pen

Page 8: Androidmeetup sg

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)

Page 9: Androidmeetup sg

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

Page 10: Androidmeetup sg

S PEN SDK WORKSHOP

Recognize pen events without contact

Screen

No contact

HoveringPen Icon

Page 11: Androidmeetup sg

S PEN SDK WORKSHOP

Recognize the side button with or without contact

Side Button Recognition

Call a Function

Hovering

Page 12: Androidmeetup sg

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

Page 13: Androidmeetup sg

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

Page 14: Androidmeetup sg

S PEN SDK WORKSHOP

SOME USE CASES

B2BEducationSNS

GameMemo &Planner

Graphics

Page 15: Androidmeetup sg

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

Page 16: Androidmeetup sg

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);

Page 17: Androidmeetup sg

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);

Page 18: Androidmeetup sg

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

Page 19: Androidmeetup sg

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.

Page 20: Androidmeetup sg

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

Page 21: Androidmeetup sg

API 17+

Chord SDK

Page 22: Androidmeetup sg

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

Page 23: Androidmeetup sg

2. Main Features

CHORD - INTRODUCTIONEvery node is part of public Chord channel.

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

CHORD

Page 24: Androidmeetup sg

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.

Page 25: Androidmeetup sg

2. Main Features

CHORD

SchordChannel

.sendData()

.sendDataToAll()

.sendFile()

.acceptFile()

.rejectFile()

SchordChannel.StatusListener

- Fires events upon incoming or outgoing data.

Page 26: Androidmeetup sg

API 14+

Media Control SDK

Page 27: Androidmeetup sg

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

Page 28: Androidmeetup sg

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

Page 29: Androidmeetup sg

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+

Page 30: Androidmeetup sg

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

Page 31: Androidmeetup sg

[email protected]@manikantan_k

Facebook.com/samsungdevs