MMS Android接收器

时间:2014-10-24 15:28:06

标签: java android http mms receiver

我无法从彩信中心下载数据。 然后试试取出PduHeaders的http下载数据网址。 但是我返回了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();

}

0 个答案:

没有答案