Professionell internetberoende • Spelentusiast • Teknikskapare
Professionell internetberoende • Spelentusiast • Teknikskapare

Hur man ansluter till en lokal Google App Engine-webbplats från din Android-enhet

Hur man ansluter till din Google App Engine-webbplats från Android-emulatorn på localhost, utan att få ett ConnectException-fel!
Den här sidan har översatts från engelska av mina mycket motiverade AI-praktikanter för din bekvämlighet. De lär sig fortfarande, så några misstag kan ha smugit sig igenom. För den mest korrekta informationen, vänligen se den engelska versionen.
Hem Blogg Hur man ansluter till en lokal Google App Engine-webbplats från din Android-enhet

Observera att detta blogginlägg publicerades i juni 2011, så beroende på när du läser det kan vissa delar vara inaktuella. Tyvärr kan jag inte alltid hålla dessa inlägg helt uppdaterade för att säkerställa att informationen förblir korrekt.

    If you are trying, from your Android application through the Android emulator, to access an external service on the same computer (such as your own Google App Engine site) by using the host name localhost or the IP-address 127.0.0.1, you might get a java.net.ConnectException java.net.ConnectException: localhost/127.0.0.1:8888 - Connection refused error - even though you can perfectly well access the service outside the Android application.
    The reason why a ConnectException occurs is because "localhost" or "127.0.0.1" inside the Android emulator is the emulator's own loopback interface, meaning all request sent to the destination will be looped backed to the emulator and won't actually be sent to your local machine.
    To by pass this, simply replace "localhost" with the IP-address "10.0.2.2", as this is a special address towards the real local host.
    Done!

    Skriven av Special Agent Squeaky. Först publicerad 2011-06-03. Senast uppdaterad 2011-06-03.

    📺 Se den senaste videon från Squeaky!

    Så här lägger du till enkla realtidsundertexter till din liveström.