0

I'm trying to create an app that multiple users would log into a server hosted over the local network. When testing the app in Flash Builder it connects, but when I run it on my phone it does not.

I'm using XMLSocket like so:

        private function connect(event:MouseEvent):void {           
            xmlSck = new XMLSocket();
            xmlSck.addEventListener(Event.CONNECT, onConnect);
            xmlSck.addEventListener(SecurityErrorEvent.SECURITY_ERROR,onSecurityError);
            xmlSck.addEventListener(IOErrorEvent.IO_ERROR,onIOError);
            Security.loadPolicyFile("xmlsocket://http://manbearpig.org/dev/flashpolicy.xml");
            xmlSck.connect("127.0.0.1", 8080);
        }

I'm not really sure about the policy file, I just threw it in there hoping that might do something.

Here's a video to illustrate what I mean

1 Answer 1

1

You need to replace the ip address on this line:

xmlSck.connect("127.0.0.1", 8080);

To be the IP address of your computer. 127.0.0.1 is the loopback address, I am guessing you do not have a server running on your phone :)

Sign up to request clarification or add additional context in comments.

3 Comments

Well I've tried 192.168.127.1 which is currently my computer's IP and no dice. Any ideas? Same error is thrown.
Try and rule out that it's not a network connectivity issue. Hard to read the error from your video :) For example, I've seen wifi routers not allow access to local web servers that were also on wireless. Try and bring up a web page from your java server on your phone's browser, etc.
Oh its not that kind of server. I'm just running a java app and using ServerSocket to communicate with the android app. It says its an io error. #2031 but that seems it could be anything to me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.