MMS Android Receiver

北城以北 提交于 2019-12-12 02:02:13

问题


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

}

来源:https://stackoverflow.com/questions/26551170/mms-android-receiver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!