MMs code for android - android

How to Attach video file to my application , and how to show video in videoview ?
have any idea about send sms with attached videofile means(mms) in android?
if possible , any body give me the Sample code about it??

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("sms_body", "some text");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
sendIntent.setType("video/mpeg");
That should be all you need.

Related

Android Facebook Messenger intent not working

im trying to share audio file on facebook messenger. Following as mention https://developers.facebook.com/docs/messenger/android#integration_with_intents here but it work to share simple text not audio file. App crash when i try to send audio on messenger.
This is intent share code
String mimeType = "audio/aac";
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setPackage("com.facebook.orca");
intent.setType(mimeType);
intent.putExtra(Intent.EXTRA_STREAM, uri);
intent.putExtra(EXTRA_PROTOCOL_VERSION, PROTOCOL_VERSION);
intent.putExtra(EXTRA_APP_ID, YOUR_APP_ID);
this.startActivityForResult(intent, SHARE_TO_MESSENGER_REQUEST_CODE);
There is no option for Facebook, but you can share email and MMS with Bluetooth. Here is my code. Take a look if it helps you:
Intent share = new Intent(Intent.ACTION_SEND);
share.setType("audio/*");
share.putExtra(Intent.EXTRA_STREAM,Uri.parse("file:///"+mypath));
startActivity(Intent.createChooser(share, "Share Sound File"));
break;

Attached audio file as a mms in android

I am develop one app that require record the voice.and that voice can be automatically attached to the mms.
i am useing this code
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
sendIntent.putExtra("address", "9999999999");
sendIntent.putExtra("sms_body", "if you are sending text");
final File file1 = new File(Environment.getExternalStorageDirectory().getAbsolutePath(),"connection.amr");
Uri uri = Uri.fromFile(file1);
Log.e("Path", "" + uri);
sendIntent.putExtra(Intent.EXTRA_STREAM, uri);
sendIntent.setType("*/*");
startActivity(sendIntent);
all of the going fine but file can't attached automatically.any idea about this??
When user click on send button that time automatically attached that file in particular number with subject and sms_body part that it.
My file Extension is .3gp
This code is perfect work in Samsung ace 5830i and Samsung Galaxy nexus but not work in Htc desire c,Htc one.
I am tested this setType.but not positive response.
sendIntent.setType("video/3gp");
sendIntent.setType("audio/*");
sendIntent.setType("*/*");
sendIntent.setType("audio/mp3");
If automatic attachement is possible or not?
Try this:
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("text-body", "if you are sending text");
sendIntent.putExtra("num", "number");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("ur file path"));
sendIntent.setType("audio/3gp");

How to send recorded voice in email?

I am developing a Android Application, In which I need to send voice by email.
Ans I want that such flow,
record a voice and send mail as a audio file in attachment.
and I want that voice should not remaining in phone or SD card.
is it possible ?
Here is what you need, It works with me.......
Uri uri = Uri.fromFile(new File(YOUR_DIR, YOUR_FILE_NAME)));
Intent it = new Intent(Intent.ACTION_SEND);
it.putExtra(Intent.EXTRA_SUBJECT, "TITLE");
it.putExtra(Intent.EXTRA_TEXT, "CONTENT");
it.putExtra(Intent.EXTRA_STREAM, uri);
it.setType("audio/rfc822");
context.startActivity(Intent.createChooser(it,context.getString(R.string.share)));
One of the solution according to me is..
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("sms_body", "some text");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
sendIntent.setType("audio/3gp");
startActivityForResult(Intent.createChooser(sendIntent, "Send mail..."),0);
with above code you can send the voice as email attachment and in the onActivityResult() you can delete the file from sdcard/memory.

Sending sound file with a SMS Intent?

I have this code to fire SMS Intent :
String uri= "smsto:";
Intent smsIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse(uri));
smsIntent.putExtra("sms_body", msgText);
smsIntent.putExtra("compose_mode", true);
startActivity(smsIntent);
I want to attach a sound file (.amr file) to the message. This file is in the raw folder.
Can I do this? and how?
Take a look at this for how to send an MMS and this to see how to get a stream to provide to the MMS intent.

Sending MMS using buttonClick in Android without the UI.Is this possible?

Can i use only a button Click for sending MMS disabling UI?
Is this possible using Intent.ActionSENDTO
Help me!
Regards.
to send an MMS then use this code snippet:
Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra("sms_body", "some text");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
sendIntent.setType("image/png");
here uri is path of your file. plus you can also define the number on which you want to send this mms

Categories

Resources