2014년 1월 26일 일요일

Group Play SDK

Group Play SDK 사용을 위한 정리

[Group Play SDK introduction]


Image - Group Play

Group Play 기능을 제공해 주는 SDK 인줄 알았더니 그게 아닌 것 같다.
할 수 있는 것은 아래와 같이 정리되어 있음.

Group Play SDK provides the following features:
  • Launches Group Play applications.
  • Checks if Group Play sessions are available.
  • Checks Group Play status to confirm if a Host or Client exists.
  • Checks user status by monitoring if they have entered or exited applications. Group Play SDK then sends the information about application use to Group Play.
  • Wi-Fi network connectivity is required to use applications that are developed with Chord SDK.

할 수 있는 것은 Group Play application을 실행하고 Session이 생성되어 있는지와 Session 내에서 Host 인지 Client 인지 확인 할 수 있는 기능을 제공함. 생각보다 제한된 functionality와 API를 제공하고 있음. 

시나리오를 봤을 때도 게임을 하다가 옆 사람하고 같이 하고 싶을때 Group play를 띄워서 private session을 생성한 뒤 다른 방법으로 게임을 진행하게 될 것으로 보인다.

그래서 주요 API는 다음과 같다.

ethod Summary
 intgetGroupPlayStatus()
           Checks the status of Group Play.
 booleanhasSession()
           Checks if a device belongs to a group.
 booleanrunGroupPlay()
           Launches Group Play and displays its start screen so that user can create or join a group.
 booleansetParticipantInfo(boolean enable)
          Hands over 3rd party application and user participant information to Group Play.
 voidstart()
          To use the Group Play SDK API, the applications being developed must be initialized.


그리고 Group Play는 위 그림에서 보다 시피 Chord SDK를 사용하고 있으며 제대로된 use scenario를 위해서는 Chord SDK를 사용해야 할 것으로 보임.

[Chrod SDK Introduction]

Figure 1: Collaboration with Chord
Figure 2: Logical groups


Feature들은 다음과 같다.

- Enable reliable, peer-to-peer communication across 
connected devices, without the need of a server 
- Connection: WiFi, Mobile hotspot, WiFi Direct 
- Group Management: Manage multiple device groups 
in a local network 
- Messaging Framework: Real-time data transfer 
across a group of devices(text messages, binary data 
and files) 

디바이스 검색, 그룹 생성, 메세지/파일 전송이 가능하다.
어차피 Group Play SDK도 Chord SDK의 subset이라 게임을 구현하려면 Chord SDK를 사용해서 구현해도 무리가 없을 것으로 보임.

[Samples]
   . Chord SDK만 사용한 간단한 게임들(TicTacToc 같은)
   . Chord SDK와 AllShare SDK를 사용한 카드 게임.


API reference로는 SchordManager를 사용해서 Channel을 만든 뒤 SchordChannel에서 Data, File들을 전달

com.samsung.android.sdk.chord

Class SchordManager


voidclose()
Stop Chord and release the resources.
List<Integer>getAvailableInterfaceTypes()
Get the list of available network interface types.
StringgetIp()
Get the IPv4 address of own device.
SchordChannelgetJoinedChannel(String channelName)
Get the channel interface for the specific channel name.
List<SchordChannel>getJoinedChannelList()
Get the list of all channel interfaces the device has joined.
booleanisSmartDiscoveryEnabled()
Check if smart discovery is enabled for the device.
SchordChanneljoinChannel(String channelName, SchordChannel.StatusListener listener)
Join the specified channel with the specified status listener.
voidleaveChannel(String channelName)
Leave the specified channel.
voidresetSmartDiscoveryPeriod()
Reset the smart discovery period for nodes.
voidsetLooper(Looper looper)
Set the specified looper object to the thread handling callback methods.
voidsetNetworkListener(SchordManager.NetworkListener listener)
Set the specified NetworkListener instance.
voidsetNodeKeepAliveTimeout(int timeoutMsec)
Set how long the node remains active before the connection times out.
voidsetSecureModeEnabled(boolean enabled)
Enable or disable secure mode.
voidsetSendMultiFilesLimitCount(int count)
Set the limit for the maximum number of simultaneous files that sendMultiFiles() can send.
voidsetSmartDiscoveryEnabled(boolean enabled)
Enable or disable smart discovery.
voidsetTempDirectory(String tmpDirPath)
Set the specified directory path to temporarily store the files that are received.
voidstart(int interfaceType, SchordManager.StatusListener listener)
Start Chord with the specified interface type and listener.
voidstop()
Stop chord.

com.samsung.android.sdk.chord

Interface SchordChannel


Modifier and TypeMethod and Description
voidacceptFile(String exchangeId, int chunkTimeoutMsec, int chunkRetries, long chunkSize)
Accept the receive request for the specified file transfer.
voidacceptMultiFiles(String taskId, int chunkTimeoutMsec, int chunkRetries, long chunkSize)
Accept the receive request for the specified multiple file transfer.
voidcancelFile(String exchangeId)
Cancel the specified file transfer.
voidcancelMultiFiles(String taskId)
Cancel the specified multiple file transfer.
List<String>getJoinedNodeList()
Get the list of nodes on the channel.
StringgetName()
Get the channel name.
StringgetNodeIpAddress(String nodeName)
Get the IPv4 address of the specified node.
booleanisSecureChannel()
Check if the channel is secure.
voidrejectFile(String exchangeId)
Reject the receive request for the specified file transfer.
voidrejectMultiFiles(String taskId)
Reject the receive request for the specified multiple file transfer.
voidsendData(String toNode, String payloadType, byte[][] payload)
Send the specified data to the specified node on the channel.
voidsendDataToAll(String payloadType, byte[][] payload)
Send the specified data to all the nodes on the channel.
StringsendFile(String toNode, String fileType, String filePath, int timeoutMsec)
Send the specified file to the specified node on the channel.
StringsendMultiFiles(String toNode, String fileType, List<String> listFilePath, int timeoutMsec)
Send the specified list of files to the specified node on the channel.

댓글 2개:

  1. 혹시 그룹플레이 기능을 명시한 최대 11명 이상사용할 수 있는 방법은 없나요?

    답글삭제
    답글
    1. 죄송합니다만 저도 잘 모르겠네요. ㅜㅜ 그런데 링크가서 확인해 보니 Group play는 Note4 이후로 지원안하는것 같네요. chord는 못 찾겠구요.

      삭제