android - How to handle the Web service exception -
android - How to handle the Web service exception -
in application getting exceptions when calling web service. exceptions
07-11 18:46:54.942: info/system.out(1180): webservice calling error ->java.net.unknownhostexception: host unresolved: www.roadbrake.com:80
07-11 18:46:54.942: info/system.out(1180): soap method error ->java.lang.nullpointerexception
is code problem or web service problem. if coding problem how can handle it?
please can help me.
thanks
you should check network connection before calling web service..
here code check network connection...
connectivitymanager conmgr = (connectivitymanager)getsystemservice(context.connectivity_service); if ( conmgr.getnetworkinfo(0).getstate() == networkinfo.state.connected || conmgr.getnetworkinfo(1).getstate() == networkinfo.state.connecting ) { //notify user online } else if ( conmgr.getnetworkinfo(0).getstate() == networkinfo.state.disconnected || conmgr.getnetworkinfo(1).getstate() == networkinfo.state.disconnected) { //notify user not online }
android
Comments
Post a Comment