java.net.socketException:operation time out when running app on real device(java.net.socketException:在真实设备上运行应用程序时操作超时)
问题描述
this code works fine on emulator, but on real device it gives
java.net.SocketException:the operation timed out ive got a php script running on my xampp server.
}
when i click on button it takes the amt of time ive set in my code, and then fails giving me the error in my textview. please help
my php code.
java.net.SocketException exception comes when the port that you are trying to reach is not closed or not available. It takes the amount of time you have specified for searching the port and then gets out.
Firstly, try to call this service on your mobile web browser to check whether it is available or not. If it does not show that means your device is not connected to the network on which this file resides.
It may be possible that your firewall is not allowing to ping your port. When you are doing with your emulator it works since its on same PC but in case of your real device it connects via local network and some time Firewall does not allow. Solution: unblock this request on firewall or try this by closing your firewall.
这篇关于java.net.socketException:在真实设备上运行应用程序时操作超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!