Sunday, 18 August 2013

How to get the device information using corona SDK

In some section of coding, you may need be to find out the current device specifications that you are using to run your corona applications. This article is about how to find out basic device information programmatically for your application using Corona SDK. Lets look at the following sample, it can help you for sure:


 To get the device Name:
        
  print("Name:"..system.getInfo( "name" ))


To get the device Model:

    print("Model:"..system.getInfo( "model" ))


To get the device Environment:

    print("Env:"..system.getInfo( "environment" ))


To get the Platform Name:

    print("Plat:"..system.getInfo( "platformName" ))


To get the Platform Version:

    print("Plat. ver:"..system.getInfo( "platformVersion" ))


To get the device Version:

    print("Ver:"..system.getInfo( "version" ))

To get the device Build:

    print("Build:"..system.getInfo( "build" ))

To get the Device ID:

    print("Dev ID:"..system.getInfo( "deviceID" ))


To get the device Language Code:

    print("Language code:"..system.getPreference( "ui", "language" ))


To get the Country:
   
  print("Country:"..system.getPreference( "locale", "country" ))


To get the Identifier:

    print("Identifier:"..system.getPreference( "locale", "identifier" ))


To get the device Language:
    
  print("Language:"..system.getPreference( "locale", "language" ))





No comments:

Post a Comment