Professionel internetafhængig • Spilentusiast • Teknologiskaber
Professionel internetafhængig • Spilentusiast • Teknologiskaber

Sådan opretter du forbindelse til et lokalt Google App Engine-websted fra din Android-enhed

Sådan opretter du forbindelse til dit Google App Engine-websted fra din Android-emulator på localhost uden at få en ConnectException!
Denne side er blevet oversat fra engelsk af mine meget motiverede AI-praktikanter for at gøre det nemmere for dig. De er stadig i gang med at lære, så der kan være sluppet et par fejl igennem. For den mest præcise information, se venligst den engelske version.
Hjem Blog Sådan opretter du forbindelse til et lokalt Google App Engine-websted fra din Android-enhed

Bemærk venligst, at dette blogindlæg blev udgivet i juni 2011, så afhængigt af hvornår du læser det, kan visse dele være forældede. Desværre kan jeg ikke altid holde disse indlæg fuldt opdaterede for at sikre, at oplysningerne forbliver nøjagtige.

    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!

    Skrevet af Special Agent Squeaky. Først udgivet 03-06-2011. Sidst opdateret 03-06-2011.

    📺 Se Squeaky's seneste video!

    Sådan tilføjer du enkle undertekster i realtid til din livestream