1
我的brodcastreceiver成功接收MMS,但無法從URL GET請求下載數據。 當我收到請求時:IOException超時。無法從URL GET請求中下載數據mms
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();
}
[MMS Android Receiver]可能的重複(http://stackoverflow.com/questions/26551170/mms-android-receiver) – LoungeKatt 2017-04-20 17:51:58
@Chekin你有沒有找到一個工作解決方案? – not2qubit 2017-05-23 10:12:44