2

I am working on an app to programmatically send an encrypted image file using MMS. I am using the code in this link, http://androidbridge.blogspot.com/2011/03/how-to-send-mms-programmatically-in.html.

This works fine for regular images and text...but when I try sending an encrypted binary file (using the content type of application/octet-stream the receiving phone seems to strip out the file when it's delivered.

I'm looking for a way to send a text body along with an encrypted image file...has anyone gotten this to work?

R. Cochran
  • 29
  • 1
  • 2

2 Answers2

0
Intent sendIntent = new Intent(Intent.ACTION_SEND);
    sendIntent.putExtra("sms_body", "hi\nSend u Audio File.");
    sendIntent.setType("audio/*");  // here is for Audio file.
    sendIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
    sendIntent.putExtra("address", senderNum);

    File file1 = new File(recordFile); // file u want to attach.
    Uri uri = Uri.fromFile(file1);
    Log.e("Path:---", "" + uri);

    sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
    startActivity(sendIntent);
0

I suppose it would depend how your image file was encrypted. If you were rather creative, you could try to preserve the picture header and encrypt the actual body of the image. I'm not sure if that encrypts everything you need/want it to encrypt, but it might be worth a shot.

Otherwise, you might need to go to other methods of file-sharing. They would be a pain and not really accomplish the same simplicity as using mms, but again, it might be worth trying.

Matt
  • 5,404
  • 3
  • 27
  • 39