Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
application:getDeviceInfo() — Gideros Forum

application:getDeviceInfo()

patriot_30patriot_30 Member
edited June 2012 in General questions
Hi!
I need to define the app environment (device / emulator). When I'm trying to call application:getDeviceInfo() it causes an error - attempt to call method 'getDeviceInfo' (a nil value). I also tried an Application:getDeviceInfo() and even application.getDeviceInfo() but no effect. Help me, please.

Comments

  • application:getDeviceInfo() works here without a problem. Which version of Gideros are you using?
  • patriot_30patriot_30 Member
    edited June 2012
    version 2012.2.2.2

    I should notice that I'm moving project from Corona to Gideros Studio and only in this project I have a problem with getting device info.
  • Then it must be something else in your code that. Maybe you are redefining application somewhere.
  • atilimatilim Maintainer
    Like @MikeHart, I've tested application:getDeviceInfo() function on both Windows, Mac OS, iOS and Android and on these 4 platforms it worked without any problem.

    Can you also write the output of:
    print(Application)
    print(application)
    print(getmetatable(application))
    print(Application.getDeviceInfo)
    print(application.getDeviceInfo)
    The output shouldn't contain any nils and should be like:
    table: 0651C958
    table: 0651CE60
    table: 0651C958
    function: 0651CFA8
    function: 0651CFA8
  • patriot_30patriot_30 Member
    edited July 2012
    table: 0914C948
    table: 09153E30
    nil
    function: 0914CF98
    nil

    I placed outputs at the beginning of main.lua file and results you see above. Where "application" might be redefined?
  • Problem solved! Mike Hart, you was right, "application" was redefined in config.lua. I want notice for everyone who moves his project from Corona SDK to Gideros Studio - edit or delete config.lua file. Thanks for everyone here!

    Likes: gorkem

    +1 -1 (+1 / -0 )Share on Facebook
  • @patriot_30 good to know, thanks for the info :)
    ThumbHurt Games / FB: ThumbHurt Games / FB: Eli/Teranth | Skype: teranth37
Sign In or Register to comment.