Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8589049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:57:06+00:00 2026-06-11T22:57:06+00:00

Hi I want to send an MMS through my application.For that my code is

  • 0

Hi I want to send an MMS through my application.For that my code is

void sendMMS()
    {
        try
        {
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            Drawable drawable = imageView.getDrawable();
            Bitmap bitmapPicked = ((BitmapDrawable) drawable).getBitmap();
            bitmapPicked.compress(CompressFormat.JPEG, 75, bos);
            byte[] image = bos.toByteArray();
            File file = new File(Environment.getExternalStorageDirectory() + File.separator + "test.jpg");
            file.createNewFile();
            // write the bytes in file
            FileOutputStream fo = new FileOutputStream(file);
            fo.write(image);

            Log.i(TAG, "image = " + image);

            Intent intentEmail = new Intent(Intent.ACTION_SEND);
            intentEmail.setType("text/plain");
            String[] recipients = new String[] { "" };

            intentEmail.putExtra(Intent.EXTRA_EMAIL, recipients);
            intentEmail.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
            intentEmail.putExtra(Intent.EXTRA_TEXT, "body of email");
            intentEmail.putExtra("sms_body", "body of sms");

            intentEmail.setType("image/jpeg");
            intentEmail.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + file.getAbsolutePath()));

            startActivity(intentEmail);
        } catch (android.content.ActivityNotFoundException ex)
        {
            Toast.makeText(this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
            ex.printStackTrace();
        } catch (Exception e)
        {
            e.printStackTrace();
        }
    }

When users click on a button, so this method is called & it shows a list of available options to perform this action.So for sending MMS user will have to select “Messaging” option.
Although this works fine for Android version 2.3 but when I run the app on version 4.0.3 then in the list of available options it does not show “Messaging” option.Which is must for sending MMS.

And when I remove the lines

intentEmail.setType("image/jpeg");
intentEmail.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + file.getAbsolutePath()));

then the list shows the “Messaging” option but I can not remove it.

I am really not getting what is the problem with it or may I will have to add something more for version 4.0.3 .

Please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:57:07+00:00Added an answer on June 11, 2026 at 10:57 pm

    Ok I solved the issue.

    My new code is

    void sendMMS()
        {
            try
            {
                ByteArrayOutputStream bos = new ByteArrayOutputStream();
                Drawable drawable = imageProduct.getDrawable();
                Bitmap bitmapPicked = ((BitmapDrawable) drawable).getBitmap();
                bitmapPicked.compress(CompressFormat.JPEG, 75, bos);
                byte[] image = bos.toByteArray();
                File file = new File(Environment.getExternalStorageDirectory() + File.separator + "test.jpg");
                file.createNewFile();
                // write the bytes in file
                FileOutputStream fo = new FileOutputStream(file);
                fo.write(image);
    
                Log.i(TAG, "image = " + image);
    
                Intent intentMMS = new Intent(Intent.ACTION_SEND);
                intentMMS.setType("image/jpg");
                intentMMS.setClassName("com.android.mms", "com.android.mms.ui.ComposeMessageActivity");
                intentMMS.putExtra("sms_body", messageFacebook);
                intentMMS.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
                startActivity(intentMMS);
            } catch (android.content.ActivityNotFoundException ex)
            {
                Toast.makeText(this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
                ex.printStackTrace();
            } catch (Exception e)
            {
                e.printStackTrace();
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to send mms through iphone. i search a lot but failed Please
I'm working on an Android application that will send MMS internally without using the
In my application i want send a email to one account.in one button click
Want to send the text from my current vb application to the Active Window
I want to send my Application to background simply clicking on Button inside my
I want to send email with my gmail account, I gave it a try,
I want send selected record to child window in Mvvm design pattern(Silverlight Application). how
I new on MVC. I want to send values between view's and don't know
I want to send these messages to an application: <00010> 00830BB8 S WM_GETDLGCODE <00011>
I have a requirement in my application in which I have to send MMS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.