# DeviceAtlas Device Detection for Apps # The DeviceAtlas Device Detection API for Apps provides a way to detect devices based on make/model strings. Using the make and model information, the API returns device information such as screen width, screen height, is mobile, vendor, model etc. To see a full list of properties in DeviceAtlas please visit: https://deviceatlas.com/resources/available-properties . ### Make-Model String Format ### DeviceAtlas expects the make/model string in a specific format. This format consists of values separated by a space character, where the mandatory values are manufacturer and model. The string is the same for all platforms: ``` "Make Model" ``` The term "Make" stands for manufacturer and the term "Model" stands for a model number. It is important to pass the string to the DeviceAtlas API in the lowercase form when using lowercased data file. Other modifications to the make or model strings obtained from the device may result in non-identification or mis-identification. For more information please visit: https://deviceatlas.com/resources/getting-started-enterprise-for-apps ### Data File ### The DeviceAtlas API relies on a device data file to function. DeviceAtlas provides daily data file updates so it is recommended to download the data file on a regular basis. This can be done manually from your account page or in an automated way via the https://deviceatlas.com/getJSON page. For more information please see: https://deviceatlas.com/resources/getting-the-data ### Library ### The DeviceAtlas Enterprise API comprises one Gem file which includes both the Device and Carrier Identification APIs. The Device Detection API namespace and main class is: **DeviceAtlas::Device::DeviceApi** ### Dependencies ### This library does not depend on any third party libraries. ### Basic Usage ### The API has a very simple interface and can be used as follows: _Initialize API_ ```ruby require 'deviceatlas' device_api = DeviceAtlas::Device::DeviceApi.new device_api.load_data_from_file "/path/to/apps_datafile.json" ``` _Get the properties_ ```ruby make_model = "samsung SM-N9005".downcase properties = device_api.get_properties(make_model) ``` _Use the properties_ ```ruby if !properties.nil? puts("Marketing Name: #{properties[:marketingName]}") end ``` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _ Copyright (c) DeviceAtlas Limited 2021. All Rights Reserved. _ https://deviceatlas.com <!-- HTML+JS for document formatting when opened in browser --> <div class="btn-group" id="main-menu" style="float:right"><a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Menu<span class="caret"></span></a><ul class="dropdown-menu"><li><a href="README.html">Main</a></li><li><a href="README.DeviceApi-Web.html">Device Detection for Web</a></li><li class="disabled"><a href="README.DeviceApi-Apps.html">Device Detection for Apps</a></li><li><a href="README.DeviceApi-Config.html">Device Detection API Config</a></li><li><a href="README.Upgrade.html">Device Detection API Upgrade</a></li><li><a href="./ApiDocs/DeviceAtlas/Device/DeviceApi.html">Device API Docs</a></li><li class="divider"></li><li><a href="README.CarrierApi.html">Carrier Identification API</a></li><li><a href="./ApiDocs/DeviceAtlas/Carrier/CarrierApi.html">Carrier API Docs</a></li><li class="divider"></li><li><a href="https://docs.deviceatlas.com/apis/clientside/latest/README.ClientSide.html" target="_blank">Client-side Component</a></li><li><a href="README.ConnectivityAnalyser.html">Connectivity Analyser</a></li></ul></div>