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

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -