2 Replies Latest reply on May 10, 2015 6:37 AM by goodnewsjim

    I can't access my server via Android.  What could be the problem?

    goodnewsjim Level 1

      Hello,

       

      I've used two communication protocols:

      Cirrus P2P

      and

      Client<>Server sockets

       

      I can communicate to my server via Android Emulator, and Web Hosted Apps.

      The same program on Android however will not communicate even with my policy server.

       

      The extent of my program is a chat room.

       

      Any help?

      I wonder if it is because I'm using Flex 4.6 so I can only use AIR 3.1 and maybe that isn't high enough AIR for Android.

      I'm going to test that now.   Does anyone else have any pointers to try?

        • 1. Re: I can't access my server via Android.  What could be the problem?
          goodnewsjim Level 1

          I made a completely new project.

          It is reduced to the socket and server.

          It works on Desktop Emulator, but debugging on an Android device I get:

          ioErrorHandler: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL: *THEURL*" errorID=2031]

          from:

          socket = new XMLSocket();

          socket.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);

          socket.connect(hostName, port);

           

          If it helps anyone, I could post my entire code project.

          I'm sure some people out there would love to have:

          A Java policy file server.

          A Java Echo socket server.

          The Flash Code to communicate to the Java Echo server.

           

          Maybe it has to do with my permissions?

           

              <manifestAdditions><![CDATA[
             <manifest android:installLocation="auto">
             <uses-permission android:name="android.permission.INTERNET"/>
             <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
             <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
             <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
             </manifest>
            
             ]]></manifestAdditions>
          • 2. Re: I can't access my server via Android.  What could be the problem?
            goodnewsjim Level 1

            Here is some source code for Flash/Java which works with Desktop/Web but not mobile: http://crystalfighter.com/bin/sockets/

            I'm pretty sure some people would like to have that.

             

            See if you can figure anything out. I know a lot of people had issues with policy files.

             

            Everything works fine until I go to debug on mobile and get:

            ioErrorHandler: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL: 127.0.0.1" errorID=2031]

             

            On the: socket.connect(hostName, port); //in XMLSocketExample in Test987 project