Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

Livecoding for GameMaker: Studio / GameMaker Studio 2 · By YellowAfterlife

[Solved] Does it work with Android VM?

A topic by drindilica created Oct 15, 2019 Views: 432 Replies: 5
Viewing posts 1 to 2
(1 edit)

Hi!


In the description it says:
"The extension works with all native modules - you can even have the code update remotely while the game's running on a mobile device or a console."

Is that really possible, to change the code and code is transfered to the Android device?

I connected my Anroid smart phone to my PC via USB-cable and I started my game on my phone via GMS2 Android VM.  The game starts on my device, but in the console I get this:
10-15 13:21:57.534  8379  8420 I yoyo    : HttpGet("http://localhost:5100/init?password=&config=default&version=103", 3)
10-15 13:21:57.542  8379  8498 I yoyo    : Exception = java.net.ConnectException: Failed to connect to localhost/127.0.0.1:5100
10-15 13:21:58.548  8379  8420 I yoyo    : HttpGet("http://localhost:5100/init?password=&config=default&version=103", 4)
10-15 13:21:58.559  8379  8514 I yoyo    : Exception = java.net.ConnectException: Failed to connect to localhost/127.0.0.1:5100
...
...

What am I doing wrong?

For Windows WM it works. I'm using it for longer time now, it's a real time saver!!!

Thank you!

Developer

You'll need to replace "127.0.0.1" by local IP address (usually 192.168.x.x) of the computer that's running GMLive server (which requires that it's on the same network with the mobile device, obviously - mobile hotspot also works for this IIRC)

(2 edits)

Hi!

Thanks for the quick answer! I tried it, but still no luck!

I pulled out network cable from my PC and connected it to the same WLAN where my android mobile phone is connected.

10.0.0.4 is now the IP address of the PC. I installed a "ping"-app on my mobile and I pinged 10.0.0.4 from the phone, it is reachable.

Then  in obj_gmlive I replaced

live_init(1, "http://localhost:5100", "");
with
live_init(1, "http://10.0.0.4:5100", "");

Then I started gmlive-server on my PC:
Listening on port 5100...
0 clients.

Then I started my game in GMS2 with Android VM. The game started on my phone.

But gmlive-server still displays:
Listening on port 5100...
0 clients.

and when I change the source code, changes are not transfered to the phone.

On the console I still see:
10-15 19:38:41.423 15267 15981 I yoyo    : Exception = java.net.ConnectException: Failed to connect to /10.0.0.4:5100
10-15 19:38:41.454 15267 15324 I yoyo    : HttpGet("http://10.0.0.4:5100/init?password=&config=default&version=103", 18)

I guess I'm still missing something!

THX

Developer

Firstly, try running it on PC itself to see if the IP is correct and attempts to connect are not being cut by firewall.

Also check if the "internet" permission is enabled in Android game options - pretty sure it just throws that error if you have no permit.

Windows WM works with 10.0.0.4.

Internet permission for Android is enabled. (It is always enabled because our game-client often contacts our game-server via http.)

Any other ideas?

Thank your for your help!

(3 edits)

I found the problem. In the Firewall private network was not enabled, just public was enabled for GMS2-Runner and gmlive-server.  See the screenshot.

I dont know now exactly if I need both, but I checked now all 4 checkboxes which I marked with red color in the screen shot.

After that the connection worked.

THX