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.
Friday, September 16, 2011
Categories: android, development, programming, tutorial, web service
Related Posts:
Belajar Java ep4 OperatorOperator terdiri dari operator logika dan aritmatika. Untuk yang aritmatika saya kira mudah dipahami, seperti biasa kita gunakan di dunia nyata kok. Operator Aritmatika Arti Operator Relasi Arti Oper… Read More
Apakah Android Itu? !-- @page { margin: 0.79in } P { margin-bottom: 0.08in } -- Menurut Google IO 2010 : Opensource dan openplatform untuk pengembangan teknologi mobile SDK, API dan sourcecodenya tersedia u… Read More
Android Programming - Url ConnectThis the basis for web service. Android + Web Service is a future will be for me. With open platform you can access open information. That's really great I think. Simple, with a piece of code to access web service in Android,… Read More
Otak-atik Ubuntu 11.04Berawal dari setting VGA SiS itu, saya jadi terarik otak-atik si Ubuntu, sesuai dengan niatan juga untuk pindah framework pemrograman Eclipse saya ke Ubuntu, biar lebih terasa lagi opensourcenya.Karena tujuan awal memindahkan… Read More
Android Programming - Setting Up Your EnvironmentThis is my first article of Android Programming Series in my blog. I'll share you how to set up an environment to begin programming in Android. Actually it was easy and the Android Developer site have a full article about thi… Read More
Subscribe to:
Post Comments (Atom)
1 komentar:
haha..
i'm IT man too..
cheerss... -_^
Post a Comment