Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
How to get device's ip? — Gideros Forum

How to get device's ip?

JalapenodevJalapenodev Member
edited March 2014 in General questions
I'm making some kind of online game, and to save all scores and things like that to database, i dont want to make register-login-system, so i want to save all data with device's ip, so there's no need to register.
But I didn't find how to check device's ip?
So how?

And little offtopic question:
Is it possible to "include (term from PHP)" website's content to code with UrlLoader?
For example like:

loader = UrlLoader.new("httpUrlToSite/luacode.php")

function onComplete(event)
include(event.data)
end

loader:addEventListener(Event.COMPLETE, onComplete)

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Gettin IP address might be tricky, as you can't simply request IP address, you need to specify device you get it from, as in WiFi, or 3G, or any external device, etc
    But there is a hack how to get it using Lua Sockets.
    Here is more on Lua Socket, including hack to find an IP address:
    http://appcodingeasy.com/Gideros-Mobile/Using-LuaSocket-in-Gideros

    About the second one, then I don't really understand.
    You can get the code of the website this way, but you can't really render it, you would need an HTML renderer for that.
    On the other hand if you want to display website, it could be easier to display it in the Webview, that is available with BHwax on ios and Native UI on Android in Gideros Labs

  • The website can grab the IP address (fairly easy to do), not the device give it.

    The ip addres on mobiles is not static btw, maybe you really want the MAC address?
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
Sign In or Register to comment.