List of Remote Key Codes in a Samsung Smart TV Application

The Remote is one of the primary interaction device in a Samsung Smart TV. Apart from Remote, various Samsung Smart TV models have various other methods of interaction like voice control, gesture control, control through external devices through the wireless and bluetooth medium, gamepad controls etc. Eventhough, all these methods of interaction exists, the Remote still remains the primary method of interaction in a Samsung Smart TV. The developer can develop various applications based on the input given from the TV Remote such as inputs for a game, inputs for user value entry, inputs for changing channel etc. Normally this would happen in such a way that, the program listens for keystrokes from the TV Remote. The keypress event handlers will be registered on the application initialization phase. These are functions that do some predefined actions once the key event occurs for the specific key they are listening to. So this action will be continued as long as the corresponding keys are pressed. The developer has to identify the key codes for the keys that he/she is interested in before developing the application. For this they will be needing the key codes for the Remote keys. Samsung Smart TV has a set of standard values to each of the Remote Keys. This article provides the key code list so that they can be identified easily in a single stretch lookup.

The following are the list of standardized key codes and their corresponding key values provided by the Samsung Smart TV Platform.

KEY_0: 17
KEY_1: 101
KEY_2: 98
KEY_3: 6
KEY_3D: 1219
KEY_4: 8
KEY_5: 9
KEY_6: 10
KEY_7: 12
KEY_8: 13
KEY_9: 14
KEY_12: 1057
KEY_AD: 1039
KEY_ANTENA: 1054
KEY_ASPECT: 653
KEY_BLUE: 22
KEY_BT_HOTKEY: 248
KEY_BT_NUMBER: 247
KEY_CALLER_ID: 1128
KEY_CC: 118
KEY_CHLIST: 84
KEY_CH_DOWN: 65
KEY_CH_UP: 68
KEY_CONTENT: 261
KEY_DIGITAL_LOCKER: 137
KEY_DISC_MENU: 1086
KEY_DMA: 260
KEY_DOLBY_SRR: 654
KEY_DOTCOM: 1253
KEY_DOWN: 29461
KEY_DVR: 1114
KEY_D_AUDIO: 1236
KEY_D_FRONT_PLAY: 1243
KEY_D_VIEW_MODE: 1249
KEY_EMANUAL: 63
KEY_EMODE: 148
KEY_EMPTY: 0
KEY_ENTER: 29443
KEY_EXIT: 45
KEY_FAVCH: 256
KEY_FF: 72
KEY_FF_: 1078
KEY_GESTURE_DOWN: 40000003
KEY_GESTURE_LEFT: 40000004
KEY_GESTURE_RIGHT: 40000005
KEY_GESTURE_UP: 40000002
KEY_GREEN: 20
KEY_GUIDE: 651
KEY_HDMI: 1139
KEY_HOME: 1118
KEY_INFO: 31
KEY_INFOLINK: 147
KEY_LEFT: 4
KEY_MENU: 262
KEY_MTS: 655
KEY_MUTE: 27
KEY_NETFLIX: 1052
KEY_PAD_0: 50000017
KEY_PAD_1: 50000101
KEY_PAD_2: 50000098
KEY_PAD_3: 50000006
KEY_PAD_4: 50000008
KEY_PAD_5: 50000009
KEY_PAD_6: 50000010
KEY_PAD_7: 50000012
KEY_PAD_8: 50000013
KEY_PAD_9: 50000014
KEY_PAGEMODE: 30000030
KEY_PANDORA: 124
KEY_PANEL_CH_DOWN: 106
KEY_PANEL_CH_UP: 104
KEY_PANEL_ENTER: 309
KEY_PANEL_MENU: 613
KEY_PANEL_POWER: 614
KEY_PANEL_SOURCE: 612
KEY_PANEL_VOL_DOWN: 204
KEY_PANEL_VOL_UP: 203
KEY_PAUSE: 74
KEY_PIP_CHDOWN: 1051
KEY_PIP_CHUP: 1050
KEY_PIP_ONOFF: 1032
KEY_PLAY: 71
KEY_PMODE: 1040
KEY_POWER: 76
KEY_PRECH: 259
KEY_REC: 192
KEY_RED: 108
KEY_RETURN: 88
KEY_REWIND_: 1080
KEY_RIGHT: 5
KEY_RW: 69
KEY_SEARCH: 1252
KEY_SLEEP: 1097
KEY_SMODE: 1043
KEY_SOURCE: 222
KEY_STEP: 1023
KEY_STOP: 70
KEY_SUBTITLE: 652
KEY_SUB_TITLE: 1089
KEY_TOOLS: 75
KEY_TTX_MIX: 650
KEY_TV: 77
KEY_TV_SNS: 1251
KEY_UP: 29460
KEY_VOL_DOWN: 11
KEY_VOL_UP: 7
KEY_VTUNER: 1049
KEY_WHEELDOWN: 29469
KEY_WHEELUP: 29468
KEY_WLINK: 115
KEY_YELLOW: 21
KEY_ZOOM1: 1083
QWERTY_KEY_0: 10000017
QWERTY_KEY_1: 10000101
QWERTY_KEY_2: 10000098
QWERTY_KEY_3: 10000006
QWERTY_KEY_4: 10000008
QWERTY_KEY_5: 10000009
QWERTY_KEY_6: 10000010
QWERTY_KEY_7: 10000012
QWERTY_KEY_8: 10000013
QWERTY_KEY_9: 10000014

My inspiration for starting an YouTube channel

Starting as an angel-list funded startup to a website having billions of active users and almost unlimited viewable video content, YouTube has come a long way since then. YouTube has been acquired by Google lately and is continuing to serve its users with video content under almost all topics, and earning billions of dollars through the Google Adsense program. Apart from gaining huge amounts of money, YouTube is also investing on its users through the Adsense program. Large number of users are benefitted from this program. All the video content hosted by YouTube is user uploaded content. Users will upload content to YouTube, and will participate in the Adsense program, and in turn will get paid based on the set of criteria defined by the Google Adsense program. In fact the top list of users are earning in millions. Apart from earning money, YouTube brings other stuff to its creators like popularity, recognition and some in case promising jobs for those who started just for fun with YouTube. When I watched all these, it created a sense of inspiration in me to start something with the YouTube channel in my free time and that was the starting point for me.

Now, I have got an inspiration to start an YouTube channel. The next thing I wanted to know was what are the things that I need to do to call myself as a YouTube vLogger or video blogger. the very first and the only thing I wanted to become a YouTube vLogger is a Google account. I already had one. so, I am already qualified to become a video logger. On knowing that, I got a little bit happy. now I have opened an YouTube channel. the next thing that came to my mind is that, what do I post in my YouTube channel. YouTube is already a place where you can find video information related to almost every topic that you have heard of. so choosing a very good and interesting topic is the second challenge. even if you choose one, what is the chance that people will find it. this thought was kind of a big block ahead of me. I went through a large number of articles on choosing a topic to start with vLogging on YouTube. before going to the search option, I had some topics on my mind. but the problem was that, i did not had the enough confidence to post contents on those topics because of the fear of my content not getting discovered by users. I would call this a discoverability fear. some of the topics that I had in mind are general web development, animation and gaming stuff. but the contents that added to my fear of publishing content is a vast list of videos that were too good on these topics and also they had a huge fan base and view count. on seeing this, I have not started to post anything yet from my side on these topics. so days just past by with no activity or initiative from my side.

Suddenly one of my friends needed some help with programming on Samsung Smart TV platform. previously I have got a little bit idea about JavaScript. Samsung Smart TV application development revolves around JavaScript in most of its part. so with the JavaScript knowledge that I had, I started developing the app for my friend in the Samsung Smart TV platform. during the development process since I was new to the Samsung Smart TV platform, I needed a lot of references. although Samsung Smart TV developer site has documentation on vast array of topics, I needed something extra to help with my development process. the more I searched, I found out that, the content related to Samsung Smart TV development was very less when compared to that of other areas of development like JavaScript, HTML, CSS and other web technologies. so somehow I managed to complete the project with the limited amount of information and knowledge I had in hand. after some days, I was again thinking on what to publish on my YouTube channel. suddenly this idea of development related to smart TVs especially Samsung Smart TVs caught my mind.

Once I got this idea, I began searching for Samsung Smart TV development content on YouTube. to my surprise, I have found only a few videos that go into core development related to the Samsung Smart TV platform. this just grabbed my mind. my previous thoughts on getting a new area to publish content on YouTube is almost impossible is completely shattered. so at this point in time, I have got a little bit confidence on what to post on my YouTube channel. so I started with Samsung Smart TV development based video tutorials. so i grabbed myself a screen recording software, and I created my first video, with the description shown as typed contents rather than audio narration because of fear of talking. Later on I added videos with voice recording. After a series of not so good editing process, I published my first video on YouTube. After my video got published, each day was like myself getting into my channel dashboard and checking out for the number of visits. I waited for almost a few months to get the first few views and unfortunately those were from my friends. As days went on, I published my next video and so on. This continued with not so much regularity. But the view count remained very few. This was a bit of bad feeling for me. Even though I have posted some content that was rare, and of limited availability, my contents are not getting noticed by users. I even tried sharing my published YouTube videos through all the most commonly used social media sites. But still there is no significant increase in the view count. I published a few videos further.

After a few months, users who are completely strangers to me watched my videos and subscribed to my channel. I have no idea how this happened. Just assumed that, my videos have reached somebody in need. Thanks to the power of social media. This went on and on. More people have started coming by, giving me suggestions, asking me doubts through comments, and somebody asked for help with their Samsung Smart TV projects. These kinds of interaction, brought a sort of inspiration and encouragement to me and slowly , I started vLogging in YouTube with a little bit more clarity and satisfaction. As more and more queries came by, I started to add more and more videos. It actually kind of feels great, when you start something out of nothing, and people who are completely strangers to you and from some other part of the globe, discover your content and mark it useful and follow it regularly. Nothing gives you a better inspiration than, your content getting noticed by somebody needful with the effort from your side.

Currently I am continuing with my channel, with lots of breaks in between publishing content on Samsung Smart TV development. I am currently planning to include the development tutorials for other platforms also including Samsung Smart TV as smart TV based development is gaining popularity day by day. Will continue to update my channel with the best of my efforts.

avPlay class functions in Samsung Smart TV

This article introduces a video that demonstrates some more intermediate functions of the avPlay class in a Samsung Smart TV. The functionalities like getting the properties of a video such as resolution, duration, bitrate and pausing, resuming, seeking, adjusting speed etc of the video are explained here. It also shows in detail about the use of those functions. More advanced functions will be discussed in the future

The Kotlin Programming Language

Computers are conquering every nook and corner in all fields day by day. The main thing that enables the computer to be flexible enough to server in all the fields is because of the variety of software that it runs. Software is a concept or functionality that can be implemented over the existing hardware without any modification. No matter whatever field, the software is intended to serve, the underlying hardware that runs it remains the same. A software is developed using one of the  many programming languages. There are many programming languages out there, each with its own set of features, that can be utilized to implement the required software functionality. Some of the major programming languages in use today are as follows.

  • C
  • C++
  • Java
  • Python
  • PHP
  • JavaScript
  • .NET

and the list goes on. There is no hidden meaning behind the ordering of programming languages in the above list. All the above languages are good at implementing the features that the user needs. It’s just that some shine better in some areas than the others. Apart from that, they are deserve the Mr. Cool status.

The list of programming languages are growing day by day. Even though a programming language can be used to build whatever stuff a programmer needs, sometimes the developer may need to get some extra workarounds in some places to get the things done. This leads to the developers thinking of alternatives for faster development. Obviously we all know that, programming is all about automating the user’s tasks. So when new needs arise, either those concepts are added to the existing language, or in some cases this leads to the development of a new programming language. When we take a look at the statistics in Wikipedia, we can see that over a period of time hundreds of programming languages have been developed.

A new language comes out when there is a need of a feature that is a shortcoming in the existing languages list, or out of someone’s pure passion towards code or a mix-up of the best of some features that are found over a variety of the existing programming languages. In that row let’s welcome KOTLIN by taking a look at what is it all about.

So What is Kotlin?

Kotlin is a statically typed programming language. It runs on the Java Virtual Machine and is compatible and interoperable with Java. It has been written for the Android world and the Web.

Why should I use Kotlin?

Concise. You can do the same stuff done using Java with Kotlin. The only difference is that, you have to write very little code in Kotlin than Java. You can drastically reduce the amount of code that you write to accomplish a task.

Safe: It safely avoids the most common errors in programming without much user interruption like NullPointerExceptions.

Versatile: With the Kotlin language, you can build applications for the Android and the web server platform with the same amount of coding knowledge. No special effort should be taken from your side to implemented those or to make the changes.

Interoperable: Kotlin is able to coexist with the existing languages and frameworks for easier interoperability of the functionalities and also to speed up the code development process. Mostly Kotlin can interact with almost all Java based libraries running in the JVM with full interoperability with Java

How does a basic Kotlin code looks like?

package hello

fun main(args: Array<String>) {

println("hello World!")

}

If you take a look at the above code, you can see that the code speaks in Java but in a scriptable format. The overall code gives you the feel of a scripting language, without losing the awesomeness of a fully fledged programming language in it.

How do I try the above code?

Each language have their own set of associated tools for the developers convenience. This helps the developer to use the tools and language to build things up easily. Kotlin also provides some options for the developers who want to build applications using it.

Try it online

Kotlin provides an online link in which you will be greeted with an IDE. This provides an editor and lots of code samples that will give you an initial dip into Kotlin. Apart from using those samples, you can also edit them and even add your own logic into it. This provides a perfect start for the beginner without doing anything for setting up the development environment.

Standalone Compiler

Once you find comfortable with the language on the online IDE, you can move further with the development by downloading  a standalone compiler for Kotlin. This enables offline development, in your system at your own convenience. The best option if you are really into building stuff rather than trying to find out the features of the language.

IntellijIDEA Plugin

The IntellijIDEA, which is considered as one of the most prominent IDE’s available is providing support for developing programs using Kotlin. This becomes more handy when you are into serious large scale development. Apart from the compiler support , this gives code completion, project wizards, snippets, debugging features etc.

Eclipse Plugin

The Kotlin plugin for Eclipse has been introduced as a trial version for Eclipse Luna. For those who feel comfortable with eclipse for development, can make use of this plugin.

Ok. Now who uses Kotlin

Kotlin, although is in the initial stages of it’s evolution, has already been tried and various applications has been build on top of it. Some of the applications include Dojo Madness, Bryx911, DFStudio, 3D Robotics etc and the list goes on. As the language evolves, it is pretty sure that more people and companies will start adopting it in the near future.

That’s great. What else?

Apart from all these basic information, the Kotlin website also has a blog where the developers are posted the latest articles, a community in which the like minded developers share their thoughts, A twitter feed and also a bug tracker list. This website also has a very good documentation, which almost provides every information regarding the language and it’s features. The developer can use it as a reference or a hands on guide. This documentation site also provides links to books that teach Kotlin in a more organized manner. You may want to have a look at that.

Conclusion

The best way to know a language is to try it out. In the initial phase, you can start with the online IDE, then as per your requirement, you can move onto terminal based compiler or IntellijIDEA based development for serious stuff.

How to play a video file in Samsung Smart TV

This video demonstrates how to play a basic video file using the avplay class in Samsung Smart TV. This video will be demonstrating the basic usage of the class like, loading a video file, playing and stopping it etc. More advanced concepts will be demonstrated in further video tutorials

Programming becomes a child’s play with Google Bloks

In this article, I am going to share with you a wonderful project from Google that I have come across. This project named Google Bloks aims to teach programming (which in my opinion is a wonderful art form) to the school students in a much more real and playful manner. In the world of modern education system, computer programming is one of the most important skills that the school students should be taught, no matter whatever fields they are interested in. Because nowadays when you look at the areas where a computer knowledge needs to be applied, it is almost everywhere. Whether you are with the medical field, astrology, agriculture, defense etc, computers have become almost unavoidable in all those areas. Computer programming is almost a bit difficult for the school students to grasp in its normal form which involves mostly keyboard based coding sessions. But kids are more attracted to playing with more real world tangible stuff than doing keyboard based coding sessions. So the normal programming logic has to be brought to such a playful level for the school students especially to grasp the concepts better and helps them to  play with it. This is what exactly Google Bloks is trying to do.

A little bit about Google Bloks

Google Bloks project is the result of collaboration between Google, Stanford University and IDEO. It comes in a very long line of research on hands on learning especially from Friedrich Froebal,  Maria Montessori and Jean Piaget’s work on learning by experience from the 1970 onwards. This research was in continuous improvement. This project enables developers, designers and other creative artists to create physical coding experiences to school students in a playful manner rather than relying on the normal keyboard based coding sessions. The levels to which this project can be utilized is still under research and is in constant development. Currently there are a few projects that have been implemented using this research. You can have a look at the video below to have a better look at this project

Physical Coding

As we all know that kids especially school children are extremely creative and exploring. They are mostly attracted to fun oriented physical games than anything else. In order to introduce the art of computer programming to them, programming has to be more physical than logical. We can use the word tangible programming to refer to physical programming right now. Making the programming process a tangible experience is a challenging task and is full of barriers. Google Blocks aims at creating an open hardware platform, that breaks the barriers in tangible programming and enables a platform for designers, hardware engineers and researchers to focus on making ways to indulge the school students in the process of computational thinking. This is getting better and better and one day it aims to become a perfect platform to teaching programming to students just like the on screen programming software Blockly.

What does a Google Block project contain

The Google Bloks project has three main core components.

  • Pucks
  • Base Boards
  • Brain Board

These can be interconnected with each other to make fun stuff that can talk to other toys or hardware that can understand these instructions and can execute the code. The instructions are send to the devices using a wifi or a Bluetooth medium.

Pucks

This is the main logic area in a Bloks project. This can range from on on off switch, a range selector , a choice selector etc to bring logic into the Bloks project. These are the systems that make the Bloks project more versatile. So the more the logic that is applied to static data (or) dynamic data, the more versatile the system becomes. The more versatile the system, the more useful functions that can be implemented using it.

Base Boards

These are modular blocks that can interconnect with each other through capacitive sensors. It can do functions like relay instructions from Puck, get audio feedback from the brain board etc. Simply say, it is something that send the commands from the puck to the brain board. It can be connected with each other in various fashions based on the code flow.

Brain Board

The brain board as the name suggests is the main processing unit of the Google Bloks project. This is built based on the Raspberry Pi Zero. This processes the instructions and also provides the interface or API (as we can call it) to the other modules of the system. This can also send the board instructions to other devices using wifi or Bluetooth.

By using a combination of the above three, various projects can be done  using it. The area where the focus is mostly relied on is making stuff that aims to teach programming to school students in a much more tangible manner.

More details regarding this project can be found on the following site.

User Interaction in Samsung Smart TV Applications

In my previous two posts, I have demonstrated you guys, how to debug a Samsung Smart TV Application by means of a YouTube video. This post is a bit theoretical. In this post, I am going to explain about user interaction in Samsung Smart TV application. Normally in almost all the modern software applications, no matter whatever the platforms they are in, are interacting with the user in some way or the other. User Interaction is the one property that makes the app more lively and takes it one step close to the user than the other apps with almost no user interaction. The user will be communicating with the app in one of the following ways

  • Giving personal details through forms
  • Giving input controls using joystick or keyboard in the case of a game
  • Smarter interactions like voice and gestures in the case of mobiles and smart televisions
  • Touch and vision based input in bio metric and security based applications and many more.

The user when interacting with the app using real world information, becomes more closer to the app than with the ones with no user interaction but just navigation. The more the user trusts the app with real world data, the more important the app becomes to the user. Samsung Smart TV also has provisions for the developers to include user interaction in the app they develop. The type of user interactions that Samsung Smart TV supports are as follows

  • IME based user input in form based text fields
  • Voice and gesture based user interaction
  • Using input devices like keyboards, pointing devices etc
  • Using mobile phones with technologies like Bluetooth

The above list is just to name a few. But there are still more and lot to come. One of the most common means of user interaction with a Samsung Smart TV app in terms of data exchange is by means of form based input fields. Samsung Smart TV helps the developers to implement this functionality be means of a concept (as I call it) called IME. So what is this IME. Well IME stands for Input Method Editor, that is used by Samsung Smart TV to enable form based text input data related functionalities in its applications. So the developers can avail this functionality, if they need to implement form based user input collection in their applications.

Let’s take a little bit more deeper look into what this IME is all about. So IME as I mentioned called as Input Method Editor is a plug-in that enables form based user input in Samsung Smart TV Applications. This is based on the XT9 technology, which is a text predicting and correcting system for mobile devices with full keyboards. The XT9 technology is a brainchild of Tegic Communications which is currently a part of Nuance Communications. This technology originated from T9 algorithm, which provided the prediction features on mobile devices with numeric keypads.

Now there arises a question. Why do we need text prediction technology in Samsung Smart TV. As we all know, the Samsung Smart TV user uses the TV remote as his primary source of input device to the TV. Now when it comes to form based user inputs, entering input values using a TV Remote is very disturbing. May be the user can adjust with one or two text input fields. But what if there are more.. Phew… Not going to happen this way right, because the user has to do multiple clicks for getting a single digit or character based on the position. This is where the text prediction comes to work. With this, the user can enter a word with less button clicks then before. Now you may ask a question. How does a user with keyboard input will get benefited from the text prediction feature. Not much. But lets me more practical in our approach and assume that almost all users are going to use the TV remote as their primary input device.

The IME is provided as a plug-in from the Samsung Smart TV Common Module. All the user have to do is initialize this plug-in and associate the text input field with this plug-in and it will take care of the rest. Once you focus towards the input field, based on its input type whether it is numeric or alphanumeric, Samsung Smart TV is going to provide with a virtual keyboard look alike interface for quicker text input, and also the list of predicted words. The predicted words can be entered by selecting them directly. This will save the user a lot of key clicks while entering user input. The IME also provides the following functionalities apart from text prediction

  • Form based user input (as already discussed)
  • Shifting focus between form elements (mostly input)
  • Notification and control functions
  • Internationalization Support

The support for IME is provided from the Samsung Smart TV core modules. The developer will not be needing any external support (plug-in) for this functionality. All you have to do is enable the plug-in, link the elements and it will do the work. The IME also provides support for language translation. This is an useful functionality that helps the user to provide the input in his native language directly (A feel in home kind of situation). This feature is kind of necessary because, the application will be spread all over the globe in terms of overall installations. I am leaving the practical related stuff to my next video tutorial in which I will be showing how to actually implement an IME based app. The video is releasing on 25th June 2016. Stay tuned.

Debugging a Samsung Smart TV application video tutorial – part 01

In this post, I have demonstrated on how to debug a Samsung Smart TV application using the Samsung Smart TV SDK version 5.1. Here I have demonstrated only a part of the development process. I will continue with this in my next tutorial. Users with other versions of Samsung Smart TV SDK will have some menus and config parameters different than the one shown in this video. Those differences can be discussed further in the comments section below.