In this article we are going to discuss the network related problems during the debugging of a Samsung Smart TV application. Debugging of a Samsung Smart TV application involves connecting and inspecting the running application inside the emulator or a TV using a chrome browser environment. The browser environment presents a chrome development tools view that enables the user to debug the current Smart TV application. The following picture shows the chrome window during the Smart TV debugging session.
For those of the developers who have already made good use of the chrome development tools, do not need an explanation for the above view. It’s the same tools and functions that are packed with the native chrome dev tools. For those of you who do need a basic idea on the chrome dev tools can watch my previous videos. I have explained the chrome dev tools part in a bit more detail, during the debugging of a Samsung Smart TV application. I have explained those videos as a two part tutorial series. The links are given as below
The chrome browser and the current Smart TV application are connected to each other just like two nodes are connected to each other in a network. The normal network connection technologies that apply to computer networks also apply to the network connection between the emulator and the browser environment. The current network type that is active between the browser environment and the emulator is indicated by the network panel in the VirtualBox environment. The image is given below
The network panel in VirtualBox can be obtained by File -> Preferences -> Network. This action has to be done with the corresponding virtual machine selected if in case you have multiple virtual machines inside VirtualBox. Inside the network tab, you can see the current network technology that the chrome browser uses to connect to the emulator. By default the networking method used by the VirtualBox software is NAT. There is also options for making a bridge network between the browser and the emulator. The emulator coming along with the Samsung Smart TV SDK 5.1 supports the NAT and the bridged network modes.
The network settings in the emulator can be accessed from the settings tab. The settings tab is shown in the following diagram.
The settings tab reveals a popup that shows the NAT and the bridged network setting. You have to make sure that the type of network that is selected here should be the same one that is selected in the network panel of the Virtualbox preference page. Based on the selected type of network, we can configure the chrome browser environment and the Virtualbox emulator to talk with each other and make the debugging process succeed.
Sometimes because of the issue with connecting to the emulator, the chrome dev tools refuses to open up. This may occur because of the following reasons.
- Improper configuration of the network parameters between the browser and the emulator
- Other generic network issues between the browser and the emulator
- Mismatch of selected network types in the emulator and the VirtualBox software.
The first case is because of giving the improper connection parameters in the Virtualbox or the emulator network interface. In the network settings page of the emulator make sure to select the correct network type which is the one selected in the network pane of Virtualbox interface. NAT and the bridge network types are supported by the emulator. When using the bridge connection, make sure that the network parameters like the ip address, subnet mask, DNS servers etc are having the correct values. Otherwise the emulator will throw mysterious errors at you, so that you will not be getting a clear idea on what type of error is caused. Once the network is set, also make sure that the selected network in the emulator is the same as the one that is selected in the network panel of the Virtualbox settings page
If the network parameters are correct and there is still an issue in connecting the browser environment with the emulator, then there may be an issue with the software configuration or error related with the installation or operating system. Most of the issues of these kind can be solved by reinstalling VirtualBox or by reinitiating the virtual machine image into the Virtualbox software. This may also be caused by the user or other software messing with the network related settings of the Virtualbox software. This can be corrected just by resetting the software.
The third type of error can be identified just by comparing the type of network that is selected in between the emulator and the browser tools. Even if the same type of network is selected, there will be sometimes confusion with that configuration part in terms of IP address, proxy etc. This can be solved by amount of manual work. The things to take care of when the network connection between the browser environment and the emulator can thus be identified using the above means and the identified error can be rectified accordingly
This article gave an overall idea on how to solve the network related issues between the connection from the debug browser environment and the emulator window. The above said methods will help us definitely in identifying the network issues and in turn rectifying them. I will be discussing about how to resize TV display contents to a specific area in our application in my following tutorial series. You can comment on the feedback of this article.