我已获得附件地址但下载超时。 这是我的代码。
公共类MmsSmsReceiver扩展了BroadcastReceiver {
public static final String MMS_RECEIVE_ACTION =" android.provider.Telephony.WAP_PUSH_RECEIVED";
@Override
public void onReceive(final Context context, Intent intent) {
if (intent.getAction().equals(MMS_RECEIVE_ACTION)) {
PduParser parser = new PduParser(intent.getByteArrayExtra("data"));
NotificationInd genericPdu = (NotificationInd) parser.parse();
byte[] data=genericPdu.getContentLocation();
try {
String url=new String(data);
Log.e("download url",url);
final byte mms[]= HttpUtils.httpConnection(context,-1L,url,null,HttpUtils.HTTP_GET_METHOD,true, "10.0.0.172", 80);
Log.e("download length", String.valueOf(mms.length));
} catch (IOException e) {
e.printStackTrace();
}
}
}
}