openconnection gives null object nd whn i use connection.getInputStream NullPointerEx

openconnection gives null object nd whn i use connection.getInputStream NullPointerException,
Iam using two services one for audio recording and one for media play of live radio channel…,in recording service i use a thread to run startRecording when all my url.openconnection,getInputStream…etc are done…