Friday, September 16, 2011

Android Programming - Access Localhost

When I developed an application that connect to my own web service ( I made my own simple web service too ^-^), I got this error "java.net.ConnectException localhost/127.0.0.1:8080 - Connection Refused".
Hei, why my application got this error? I check my web service, it up and running well, I check the AndroidManifest, I already added the permissions to access Internet, what else?
This is happen because I read no documentation before about connecting to Localhost in Android, it has stated in Android Doc, that connection to localhost is a loopback address of the Emulator or handset. I need to use 10.0.2.2 address. What a dumb, you can read the explanation here.

Categories: , , , ,

Related Posts:

  • Android Programming - Access LocalhostWhen I developed an application that connect to my own web service ( I made my own simple web service too ^-^), I got this error "java.net.ConnectException localhost/127.0.0.1:8080 - Connection Refused". Hei, why my applicati… Read More
  • Android Programming - Luas BangunI created (actually it based on someone tutorial and I modified it in some place, I can find the original link..) this very simple program to learn more about User Interface. How to layout, using Button, TextView and Edit Tex… Read More
  • Android Programming - Hello WorldOkay, the preparation phase is complete. You can now make Android Project. Let us start with the classic way in which a program Hello World. Let us immediately make, you need not know anything yet, we make first and I will… Read More
  • Android Push Notification !-- @page { margin: 0.79in } P { margin-bottom: 0.08in } -- Dalam OS Android sampai saat ini belum tersedia dukungan untuk push notification secara native seperti milik Blackberry ataupu iOS. Secara fasilitas UI… Read More
  • Android Article ListThis is my Android article list : Android Programming - Access Localhost Android Programming - Fast Way Preserving Sqlite Database Android Programming - Hello World Android Programming - ListView, ListActivity with Header A… Read More

1 komentar:

Anonymous said...

haha..
i'm IT man too..
cheerss... -_^

Copyright © 2025 Johannes Dwi Cahyo | Powered by Blogger

Design by Anders Noren | Blogger Theme by NewBloggerThemes.com | BTheme.net      Up ↑