# Android multiplayer wlan: Android as host device problem

**URL:** <https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848>\
**Category:** Mobile\
**Tags:** unreal-engine, Android\
**Created:** [November 30, 2015, 7:45pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848 "2015-11-30T19:45:07Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![mhnoni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mhnoni](https://forums.unrealengine.com/u/mhnoni)\
**Post date:** [June 4, 2016, 5:20pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/21 "2016-06-04T17:20:26Z")

</div>

> [@Pabooklas;541427](#):
>
> I just tested with two phones and also android server with pc trying to join. Everything works.

Did you use router ? or Wi-Fi Direct as i like ti know if Wi-Fi Direct and Bluetooth added to 4.12 .

---

<div class="post-metadata">

**Author:** ![Pabooklas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pabooklas](https://forums.unrealengine.com/u/Pabooklas)\
**Post date:** [June 4, 2016, 5:30pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/22 "2016-06-04T17:30:35Z")

</div>

I used router.

---

<div class="post-metadata">

**Author:** ![FuTou](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FuTou](https://forums.unrealengine.com/u/FuTou)\
**Post date:** [September 24, 2016, 6:14pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/23 "2016-09-24T18:14:50Z")

</div>

> [@mhnoni;540691](#):
>
> it will be with 4.12

Man, this is really important. Now that 4.13 is out, when can iphone’s play with each other?

---

<div class="post-metadata">

**Author:** ![Brechtos](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brechtos](https://forums.unrealengine.com/u/Brechtos)\
**Post date:** [November 6, 2016, 3:54pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/24 "2016-11-06T15:54:29Z")

</div>

Well I seem to be having the exact opposite problem.

I can host on phone and have other phones and/or PC’s connect. But for the project I’m working on I want to connect to a pc host via my phone over local wifi lan.  
Is anyone having the same problem where this no longer works now? Or am I missing something that would allow my phone to find/connect to the pc listen host?  
I’m running on 4.13.2.

---

<div class="post-metadata">

**Author:** ![BPANDREW](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bpandrew/32/1194681_2.png) [@BPANDREW](https://forums.unrealengine.com/u/BPANDREW)\
**Post date:** [November 15, 2016, 6:05pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/25 "2016-11-15T18:05:13Z")

</div>

So I started reading this today - [NAT Punch-through for Multiplayer Games | Keith Johnston](https://keithjohnston.wordpress.com/2014/02/17/nat-punch-through-for-multiplayer-games/)

I’m going to try and modify my setup now… unless I’m reading this wrong, all I need to do is make my master server give my game host a list of ip addresses of people who want to connect to my game, then on my phone server, send outbound packets to those client ips on those ports, therefore opening the nat

this should be pretty easy seeing as my client server already has a heart beat report to my master server as it is anyway

---

<div class="post-metadata">

**Author:** ![MasterOfShapes](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MasterOfShapes](https://forums.unrealengine.com/u/MasterOfShapes)\
**Post date:** [December 9, 2016, 11:46pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/26 "2016-12-09T23:46:18Z")

</div>

> [@BPANDREW;623677](#):
>
> So I started reading this today - [NAT Punch-through for Multiplayer Games | Keith Johnston](https://keithjohnston.wordpress.com/2014/02/17/nat-punch-through-for-multiplayer-games/)
> 
> I’m going to try and modify my setup now… unless I’m reading this wrong, all I need to do is make my master server give my game host a list of ip addresses of people who want to connect to my game, then on my phone server, send outbound packets to those client ips on those ports, therefore opening the nat
> 
> this should be pretty easy seeing as my client server already has a heart beat report to my master server as it is anyway

Did this end up working for you?

---

<div class="post-metadata">

**Author:** ![BPANDREW](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bpandrew/32/1194681_2.png) [@BPANDREW](https://forums.unrealengine.com/u/BPANDREW)\
**Post date:** [December 10, 2016, 8:24pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/27 "2016-12-10T20:24:40Z")

</div>

I’ve put a fair amount of time into this but I’m not successful yet

what I’ve got done so far

1. my http master server now collects ips of players wishing to join sessions being hosted on phones, it then sends that ip list to the phone
2. the phone then starts sending tcp and udp messages to the other phones IP

however I’m seeing its more complicated than that as that alone isnt working. I read somewhere that in the old days of star craft, players would punch open the ports by connecting from computer A to B then B to A and it would work - with Unreal Engine that alone dosn’t work

So what I got was wireshark, I need to see what exactly happens a successful connection happens.

A problem I have yet still, is when I create tcp and udp sockets, if I’m trying to punch 7777, what do I have to do exactly to open the port… and can I create that socket if its already being used by the engine.

This really isnt my strong suit, I’d love for someone to help the community out and share a working NAT punch example, if I eventually figure this out I will update my current github demo to a more generic and easily learnable solution - [GitHub - bitporters/RC\_TRAINER: Unreal Sample Mashup with C++ Layer Multiplayer Elements (chat &am](https://github.com/bitporters/RC_TRAINER) (http based game browser, +nat punch when I figure it out)

---

<div class="post-metadata">

**Author:** ![ANURAGX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ANURAGX](https://forums.unrealengine.com/u/ANURAGX)\
**Post date:** [April 1, 2017, 6:37pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/28 "2017-04-01T18:37:31Z")

</div>

Any updates

> [@BPANDREW;636164](#):
>
> I’ve put a fair amount of time into this but I’m not successful yet
> 
> what I’ve got done so far
> 
> 1. my http master server now collects ips of players wishing to join sessions being hosted on phones, it then sends that ip list to the phone
> 2. the phone then starts sending tcp and udp messages to the other phones IP
> 
> however I’m seeing its more complicated than that as that alone isnt working. I read somewhere that in the old days of star craft, players would punch open the ports by connecting from computer A to B then B to A and it would work - with Unreal Engine that alone dosn’t work
> 
> So what I got was wireshark, I need to see what exactly happens a successful connection happens.
> 
> A problem I have yet still, is when I create tcp and udp sockets, if I’m trying to punch 7777, what do I have to do exactly to open the port… and can I create that socket if its already being used by the engine.
> 
> This really isnt my strong suit, I’d love for someone to help the community out and share a working NAT punch example, if I eventually figure this out I will update my current github demo to a more generic and easily learnable solution - [GitHub - bitporters/RC\_TRAINER: Unreal Sample Mashup with C++ Layer Multiplayer Elements (chat & game browser using external web app)](https://github.com/bitporters/RC_TRAINER) (http based game browser, +nat punch when I figure it out)

I am working on the same and if I figure out anything will post here.

Even I am in need of such functionality and I really hate UE4 community or especially EPIC GAMES, they only help other developers who are quite popular on the forum or whose problem is the exact problem which epic games are facing.  
Epic games won’t show any helpful attitude to those threads which are not related to them. For instance consider this thread which happens to be around 1.5 years old and none of the epic staff have shared any info on this topic.

---

<div class="post-metadata">

**Author:** ![ANURAGX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ANURAGX](https://forums.unrealengine.com/u/ANURAGX)\
**Post date:** [April 1, 2017, 6:52pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/29 "2017-04-01T18:52:36Z")

</div>

> [@BPANDREW;636164](#):
>
> I’ve put a fair amount of time into this but I’m not successful yet
> 
> what I’ve got done so far
> 
> 1. my http master server now collects ips of players wishing to join sessions being hosted on phones, it then sends that ip list to the phone
> 2. the phone then starts sending tcp and udp messages to the other phones IP
> 
> however I’m seeing its more complicated than that as that alone isnt working. I read somewhere that in the old days of star craft, players would punch open the ports by connecting from computer A to B then B to A and it would work - with Unreal Engine that alone dosn’t work
> 
> So what I got was wireshark, I need to see what exactly happens a successful connection happens.
> 
> A problem I have yet still, is when I create tcp and udp sockets, if I’m trying to punch 7777, what do I have to do exactly to open the port… and can I create that socket if its already being used by the engine.
> 
> This really isnt my strong suit, I’d love for someone to help the community out and share a working NAT punch example, if I eventually figure this out I will update my current github demo to a more generic and easily learnable solution - [GitHub - bitporters/RC\_TRAINER: Unreal Sample Mashup with C++ Layer Multiplayer Elements (chat & game browser using external web app)](https://github.com/bitporters/RC_TRAINER) (http based game browser, +nat punch when I figure it out)

I think when we connect one android(client - wifi on) to another android(host - hotspot on), the host expects client coming from cellular network but client is sending request from wifi network.  
If you see there is no error in creating server on android, the only broken link is searching and joining session.  
This is my theory.

---

<div class="post-metadata">

**Author:** ![PiterMyasnikov](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PiterMyasnikov](https://forums.unrealengine.com/u/PiterMyasnikov)\
**Post date:** [February 11, 2019, 8:14am UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/30 "2019-02-11T08:14:04Z")

</div>

So for android multiplayer working it need just to rebuild windows, android development/shipping from the source code? Is anyone know for a ue4.21 it still need rebuild? And if so what branch I need to use? Same branch as a version of unreal engine that I use?  
And what about IOS? Same steps needed?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7ad6fa69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7ad6fa69](https://forums.unrealengine.com/u/anonymous_user_7ad6fa69)\
**Post date:** [April 26, 2019, 5:04am UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/31 "2019-04-26T05:04:04Z")

</div>

4.22.1 is out now. Has anyone tested this yet?  
I still have trouble ☹ My device hosted localhost session with ip is 127.0.0.1

---

<div class="post-metadata">

**Author:** ![slabs37](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@slabs37](https://forums.unrealengine.com/u/slabs37)\
**Post date:** [April 26, 2019, 1:18pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/32 "2019-04-26T13:18:50Z")

</div>

can someone please test it? ☹ in 4.21 the phone ip is given wrong and it doesn’t join ☹ please someone test it and tell us

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0a267201](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0a267201](https://forums.unrealengine.com/u/anonymous_user_0a267201)\
**Post date:** [April 28, 2019, 12:46am UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/33 "2019-04-28T00:46:01Z")

</div>

Working on that as well. Trying to run either two Android phones MP, or one Android client with Win server.

---

<div class="post-metadata">

**Author:** ![Biggs](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/biggs/32/920253_2.png) [@Biggs](https://forums.unrealengine.com/u/Biggs)\
**Post date:** [April 28, 2019, 10:34pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/34 "2019-04-28T22:34:36Z")

</div>

> [@anonymous\_user\_7ad6fa69](#):
>
> 4.22.1 is out now. Has anyone tested this yet?  
> I still have trouble ☹ My device hosted localhost session with ip is 127.0.0.1

Hey all ran across this thread digging for days while facing the exact same issue in 4.21.

So as we were testing multi-platform capabilities we kept getting 127.0.0.1 issues on the android devices. I saw this thread and then tested in 4.22.1.

So some things broke for us in the update but I can confirm that it seems to at least connect android to android in this version. The 127.0.0.1 issue seems resolved but it does leave us with some tough decisions dealing with a full conversion as it creates unknowns late in our cycle.

Wanted to let you all know- Good luck!

---

<div class="post-metadata">

**Author:** ![LaurentLKO](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LaurentLKO](https://forums.unrealengine.com/u/LaurentLKO)\
**Post date:** [August 15, 2019, 2:37pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/35 "2019-08-15T14:37:24Z")

</div>

Hi,

Tried on 4.23 beta 6, still the same error 127.0.0.1  
Anyone with a workaround ?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_35ded9361](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_35ded9361](https://forums.unrealengine.com/u/anonymous_user_35ded9361)\
**Post date:** [October 14, 2019, 10:56am UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/36 "2019-10-14T10:56:43Z")

</div>

It still creates the host with the local IP adress on my S8. I’m using 4.23. Is this bug still around or am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![Hermyth](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hermyth](https://forums.unrealengine.com/u/Hermyth)\
**Post date:** [October 18, 2019, 7:27am UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/37 "2019-10-18T07:27:32Z")

</div>

4.23. When Host game on S8, can join from PC. If host game on PC, cannot join from S8.

---

<div class="post-metadata">

**Author:** ![hossamxnowiser](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hossamxnowiser](https://forums.unrealengine.com/u/hossamxnowiser)\
**Post date:** [November 15, 2019, 5:10pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/38 "2019-11-15T17:10:52Z")

</div>

> [@aussieburger](#):
>
> Here’s a brief step-by-step for how I got it working. PS: I’m not a C++ programmer either and while the end result of these steps is it all works via blueprints, you do need to mess around with visual studio unfortunately:
> 
> 1. link your unreal and github account as per: [Unreal Engine on GitHub](https://www.unrealengine.com/ue4-on-github)
> 2. download the zip source code of the engine: [https://github.com/EpicGames/UnrealEngine/tree/4.10](https://github.com/EpicGames/UnrealEngine/tree/4.10)
> 3. have Visual Studio express installed
> 4. exact zip and run setup (will take ages)
> 5. run GenerateProjectFiles.bat as admin
> 6. open UE4.sln which will open UE4 source in Visual Studio
> 7. Build windows 64 | Development Editor (will take ages)
> 8. replace the **two whole files** from the pull request: [https://github.com/EpicGames/UnrealEngine/pull/1820/files](https://github.com/EpicGames/UnrealEngine/pull/1820/files)
> 9. Build Android | Development (will take ages)
> 10. Build Android | Shipping (will take ages)
> 11. Now you can open your freshly built engine with the fix in place. Located: \Engine\Binaries\Win64\UE4Editor.exe (it will take absolutely ages the first time you open and do anything)
> 
> For all that building stuff you can find documentation from Epic games on how to do it on this link: [https://github.com/EpicGames/UnrealEngine/tree/4.10](https://github.com/EpicGames/UnrealEngine/tree/4.10)
> 
> I actually used branch 4.9 however all branches should work in theory
> 
> Annoying we need to do this - hope Epic can give feedback on putting the fix in for all! 🙂

i cant get to links of github , i have linked my account but its not working

any one solve hosting on android devices plz help

thx all

---

<div class="post-metadata">

**Author:** ![aussieburger](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@aussieburger](https://forums.unrealengine.com/u/aussieburger)\
**Post date:** [November 20, 2019, 4:40pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/39 "2019-11-20T16:40:36Z")

</div>

> [@hossamxnowiser](#):
>
> i cant get to links of github , i have linked my account but its not working
> 
> any one solve hosting on android devices plz help
> 
> thx all

I just checked the git links are definitely still working fine. Epic hosts all of their source code there! Double you checked you linked the correct account as per the instructions here:

> **[Unreal Engine on GitHub](https://www.unrealengine.com/de/ue-on-github)**
>
> Find out how to access Unreal Engine source code on GitHub

logout and log back into github?

PS: this workaround should in theory only be required for versions before 4.12…

---

<div class="post-metadata">

**Author:** ![loxless](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@loxless](https://forums.unrealengine.com/u/loxless)\
**Post date:** [January 7, 2020, 2:56pm UTC](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848/40 "2020-01-07T14:56:34Z")

</div>

Something for 4.24? 4.23 returns localhost during session connection

[Previous page](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848.md?page=1)

[Next page](https://forums.unrealengine.com/t/android-multiplayer-wlan-android-as-host-device-problem/48848.md?page=3)
