This topic describes how to retrieve platform information from a Samsung device.
ProductInfo API
SystemControl API
SystemInfo API
Web application APIs
Some API specifications and features vary in implementation between device model groups. To ensure that your application runs on various device models, you need to retrieve the device platform information and implement your application features accordingly.
You can retrieve platform information in 3 ways:
Using the Web standard Navigator interface, retrieve the user agent string for the device with the userAgent property:
userAgent
var userAgent = navigator.userAgent console.log(userAgent);
The user agent string has the following structure:
Mozilla/$(MOZILA_VER) ($(DEVICE_TYPE); $(OS); $(PLATFORM) $(PLATFORM_VER) $(COMPANY_NAME) $(MODEL_NAME)) AppleWebKit/$(APPLEWEBKIT_VER) (KHTML, like Gecko) $(APP_NAME)/$(APP_VER) $(UX RECOMMENDED) Safari/$(SAFARI_VER)
The following table lists the user agent string fields that have distinctive values for Samsung devices.
The user agent strings for Samsung TVs and display devices are listed in the following table.
Using the Samsung Product API, retrieve information about the device, such as the firmware version, the model and the serial number , with the ProductInfo API and the SystemControl API:
var firmware = webapis.productinfo.getFirmware(); console.log(firmware);
var model = webapis.productinfo.getModel(); console.log(model);
var serialNumber = webapis.systemcontrol.getSerialNumber(); console.log(serialNumber);
Using the Tizen API, retrieve the Tizen version with the SystemInfo API:
var capability = tizen.systeminfo.getCapability('http://tizen.org/feature/platform.version'); console.log(capability);