0

I can not download the data from the MMS center. Then try on http download data url that took out PduHeaders. But I returned IOException Time Out. i cannot download data from a URL GET request, but standart app dowload.(Hangouts)

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 = vl.getAsString("ct_l");

        new Thread(new Runnable() {
                @Override
                public void run() {
                        try {
                                ensureRouteToHost(context, contentLocation,  "10.10.10.10");
                                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();

}
Chekin
  • 11
  • 2

0 Answers0