My brodcastreceiver successfully receives MMS, but I cannot download data from a URL GET request. When I get a request : IOException Time Out.
public class MMSReceiver extends BroadcastReceiver {
Context context;
ConnectivityManager manager;
public void onReceive(final Context context, Intent intent) {
this.context = context;
Bundle bundle = intent.getExtras();
manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
byte[] buffer = bundle.getByteArray("data");
GenericPdu genericPdu = new PduParser(buffer).parse();
ContentValues vl = getParams(genericPdu);
final String contentLocation = "http://mmscr:8002/0420000037936141022152222001";
new Thread(new Runnable() {
@Override
public void run() {
try {
ensureRouteToHost(context, contentLocation , "10.10.10.10");
// THIS HTTP GET REQUEST \/\/\/\/\/\/
byte[] rawPdu = HttpUtils.httpConnection(context, SendingProgressTokenManager.NO_TOKEN,contentLocation , null, HttpUtils.HTTP_GET_METHOD, true, "10.10.10.10", 8080);
Log.i("mLogs", "DATA :" + rawPdu.length);
} catch (IOException e) {
e.printStackTrace();
}
}
}).start();
}