1

受信した mms からデータを読み取る方法を教えてください。mms を受信しましたが、そこからデータを取得して保存することができません

public class MmsReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
    String action = intent.getAction();
    String type = intent.getType();

    Utils.PrintInfo("Action : "+action+", Type : "+type);

        Bundle bundle = intent.getExtras();

        Utils.PrintDebug("bundle " + bundle);

        if (bundle != null) {

            for(String k:bundle.keySet()) {
                Utils.PrintInfo(k);
            }

            byte[] buffer = bundle.getByteArray("data");
            Utils.PrintDebug("buffer " + buffer);
            String incomingNumber = new String(buffer);

            int indx = incomingNumber.indexOf("/TYPE");
            if (indx > 0 && (indx - 15) > 0) {
                int newIndx = indx - 15;
                incomingNumber = incomingNumber.substring(newIndx, indx);
                indx = incomingNumber.indexOf("+");
                if (indx > 0) {
                    incomingNumber = incomingNumber.substring(indx);
                    Utils.PrintDebug("Mobile Number: " + incomingNumber);
                }
            }

            int transactionId = bundle.getInt("transactionId");
            Utils.PrintDebug("transactionId " + transactionId);

            int pduType = bundle.getInt("pduType");
            Utils.PrintDebug("pduType " + pduType);

            byte[] buffer2 = bundle.getByteArray("header");
            String header = new String(buffer2);
            Utils.PrintDebug("header " + header);
        }
}

}

そのmmsからのデータは次のようになります

データ: ???1351504361@mms2??????+48668822862/TYPE=PLMN??????????????? http://mmsc.play.pl/?id=1351504361B ??

どうすればそこから画像を取得できますか? - 他のデバイスからそのデバイスに画像を送信しました

4

0 に答える 0