Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Runtime Development

Reply
Contributor
gr8pathik
Posts: 10
Registered: ‎05-20-2013
My Device: Blackberry q10
My Carrier: reliance

Doubts regarding receiving port based SMS using Socket connection in Android

I am trying to receive port based SMS with the below piece of code.

         serverSocket =newServerSocket(SERVERPORT);

Socket client = serverSocket.accept();

try{

BufferedReaderin=newBufferedReader(newInputStreamReader(client.getInputStream())); line =null;

while((line =in.readLine())!=null){

Log.d("ServerActivity", line);

System.out.println("Reading Line is>>>>>>>>>>>>>"+line);

break;

}

}catch(Exception e){

System.out.println("Exception While Reading SMS>>>>>>>>>>"+e);

}

Will it wait in the line of serverSocket.accept(); until it gets the port based SMS,Is this correct behaviour or I am making any issue which hangs at that place.I am not able to move beyond it.

I am not able to test fully,I am not having option of testing it here,sending the port message.

Did anyone came across this issue.Any Info regarding this will be useful.

Please use plain text.