Ad

Sunday, August 25, 2013

Setting up the Samsung Chord SDK

Continuing from the previous posts, I would like to write about setting up the development environment for using the Chord Android SDK and give an overview of the main classes to be used for your first program (to come in a later article).

This is towards aiding android developers in writing apps for the Samsung Android Contest.

  1. Download the Samsung Chord SDK available here
  2. Download the Samsung Chord SDK emulator also available here (need to accept the license agreement in order to download both)
  3. Add the Eclipse plugin for Chord SDK as described in "Chord SDK Emulator Guide ver1.2".
  4.    You can download sample apps from the chord sdk link and run it on the emulator.
  5. The screen shot shows the basic interface of the sample demo. Of course, this can meaning fully execute only after you start the Chord Relay server in the eclipse environment which shows the console and how the UDP broadcast is happening from the emulator. This allows you to do basic stuff like Starting Chord, Joining and leaving a channel.


While the above shows the basics in terms of getting up the first Samsung chord SDK app to work, we need to understand what the Android SDK gives us and what are the classes we have to use to create our own app.

What are the basic classes and interfaces provided by the Chord Android SDK? All of the fundamental ones are described here:

ChordManager– This forms the core of the SDK. This is used to create a Node and helps in managing which nodes are connected to which channels. If you want to know more about channels and nodes, please refer the previous article.

This is the class that hides all the network complexity from the developer. These are the basic features provided by this class:
  1. Tells you the list of available network interfaces like wi-fi or Mobile Access Point etc.
  2.  It gives you an option to start and stop chord
  3.  It gives you an option to leave or join a channel
  4.  Helps you list all the channels the node has joined
  5. And also provides a way to hook up a network listener to respond to changes in the network status.


Most of the main service or game or whatever your application is aiming to achieve through node interactions should be through using the Chord Manager. However, your app – the game or service will also have to provide implementation for 3 listeners:

  1. INetworkListener-  ChordManagerhas to listen on this listener to understand the changes in the network state – whether connected or disconnected to the network (of choice – wifi, wifi direct etc.)
  2.  IChordChannelListener– It is through this listener you will have to implement all actions that need to happen when a node joins the network or leaves a network.  Through this you also need to implement what happens when a file/data is received or sent.
  3. IChordManagerListener– is a listener that needs to be implemented when you start your ChordManager. This is required to handle the changes when a ChordManagerstarts. Also, after starting, the ChordManager, if there is an error or a network disconnect, what should the ChordManagerdo – is defined in the implementation of this listener.

The above 4 classes/listeners help in implementing your own service that can be used with all your nodes in the network.

However, while you have the entire above service ready, you need to decide which channels are you interested in interacting with?  It could be the public channel or a private channel with a specific name or even many at a time.

The specific channel implementations are those classes that a developer needs to develop by implementing the IChordChannelInterface.

The interface provides the methods for sending and receiving data.

So, in summary, you have the crux of what you really want to do in your own implementation of the IChordChannel.

However, the ChordManagerhelps you manage connecting and communicating with various nodes in the private or public channels by using 3 listeners.

It is as simple as that. Hope this clarifies the Samsung Chord SDK a bit in order for you to be able to take part in the Samsung Smart App Challenge.




Sunday, August 18, 2013

Samsung Chord SDK - An Introduction

The Samsung Smart App challenge has motivated me to explore a bit more about the Samsung Chord SDK.

If you want to know more about the SamsungSmart App Challenge, please visit here  or to know more about the Android SDK – Here . There is a growing community for the android developer as well. 

Here is that I understand are the highlights of this SDK:
1.     It is a framework developed by Samsung for networking between devices – making it easy for people without network programming skills.
2.     It is not physical network connection that is created. It is application layer messaging protocol that uses the underlying TCP/IP network. i.e it is different from wi-fi or Bluetooth which work on a physical network protocol.
3.     Samsung also provides an add-in emulator to the standard eclipse development environment to test the networking of your apps.
4.     The Chord SDK allows creating a network of devices allowing for an n:n communication. It supports
a.     Synchronized content sharing
b.     Broadcast of messages to near by devices
c.      Data transfer between devices
d.     Multi-player games
5.     The Security features need improvement as any mobile with the same app on it can join the group or leave the group
6.      Chord supports only Android 4.0 and above


A bit about the architecture of the Chord SDK:

(This diagram is from Samsung SDK documentation.)


The application layer is where our imagination can be used to build innovative apps.

There are a few other basic aspects we need to understand in order to be able to use the Chord SDK.
1.     Channel Manager – This is the part of the software that manages all the mobiles in a network. The various devices are called nodes
2.     Messaging protocol – This is the part of the SDk that helps in exchanging of messages between the nodes
3.     File Transfer Protocol – This is the protocol used for file transfers between the nodes
4.     Discovery protocol -  This is the component that helps in discovering the various devices within range to for the logical group of nodes
5.     ZeroMQ – This is the underlying layer that helps with all the messaging and file transfers

A little bit more about Channels before we get into coding J

Chord has the concept of 2 types of channels for communication:
1.     Public Channel
2.     Private Channel

The Public channel is one one, which any device running the Chord SDk can join.
A private channel is one, which is created by nodes having the same chord SDK based application. 

So, if my mobile has Chord SDK app, I am part of a public channel. If I have an app A and an app B, I can be part of Channel A and Channel B respectively.

In the next article, I will talk about setting up the environment for developing using Chord SDK and later we will develop a simple app using Chord SDK.

Thursday, August 8, 2013

Samsung Smart App Challenge - Wonderful Addition to the growing Android Developer Community

I used to follow closely on the Google Developer challenge. But I was not aware that Samsung too had started something on the same lines last year. I came across this Android Contest as I was browsing and realised it has happened once already in 2012 !! And it is being thrown open once again this year! Samsung Smart App challenge 2013! Interesting…  Seems like the best way to get the developer community engaged! 

The entry to the competition has just begun – It is open till August 31st !

It seems an interesting competition. But the caveat seems to be that you have to use “Samsung Chord SDK”

The Chord SDK itself seems all the more interesting ! This Android SDK enables real-time sharing between devices without the cloud!! It allows for quickly connecting with nearby devices and thus sharing data, media and even playing fun games. This seems a welcome addition for the Android App Developer.

It seems like THE protocol that is going to take the developer community by storm considering the huge possibilities of the usage of peer-to-peer networks, without the need of a server! This allows for 1-to-1, 1-to-many and many-to-many device connections increasing the possibilities.

 As I look at this challenge and the Chord SDK, I would be blogging a bit more about it. In the meantime, curious to see anyone from the developer community visiting my blog interested or participating?

Would be great to hear your thoughts..

While the competition entries are open to 31st August, the judgement is from October to November and the results would be declared by December.


The price money seems very encouraging. But the other benefits may all the more entice all budding entrepreneurs. There is a good chance that Samsung itself may support through its venture capital funding arm and will provide a lot of support in terms of promotional benefits – which is not too quantifiable but cannot be absolutely undermined !! More details on the awards and judges here.