0

我无法从彩信中心下载数据。然后尝试取出 PduHeaders 的 http 下载数据 url。但我返回了 IOException Time Out。我无法从 URL GET 请求下载数据,但标准应用程序下载。(环聊)

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();

}
4

0 回答 0