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 9186195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:27:54+00:00 2026-06-17T19:27:54+00:00

I want to send a MMS using the stock MMS source. Before more explanation,

  • 0

I want to send a MMS using the stock MMS source. Before more explanation, I want to say that it does work on some android versions but 4.0.3 and 4.0.4.

In my service, I ask the device to enable the MMS network feature using the following code:

createWakeLock();

int result = mConnMgr.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, PhoneEx.FEATURE_ENABLE_MMS);

Log.v(TAG, "beginMmsConnectivity: result=" + result);

switch (result) {
    case PhoneEx.APN_ALREADY_ACTIVE:
    case PhoneEx.APN_REQUEST_STARTED:
        acquireWakeLock();
        return result;
}

throw new IOException("Cannot establish MMS connectivity");

On some devices (Xperia T running 4.0.3), it throws an exception because result equals PhoneEx.APN_TYPE_NOT_AVAILABLE. The MMS is enabled in my phone settings and I can send one with the stock mms app.

On other devices (HTC Desire S running 4.0.4), the problem is located a bit further, in the ConnectivityBroadcastReceiver. Here is my code:

private class ConnectivityBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(final Context context, Intent intent) {
        String action = intent.getAction();

        mNetworkInfo = (NetworkInfo) intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
        mOtherNetworkInfo = (NetworkInfo) intent.getParcelableExtra(ConnectivityManager.EXTRA_OTHER_NETWORK_INFO);

        networkAttempt++;

        if (networkAttempt < APN_RETRY_ATTEMPTS) {
            // Check availability of the mobile network.
            if ((mNetworkInfo == null) || (mNetworkInfo.getType() != ConnectivityManager.TYPE_MOBILE_MMS)) {
                // ERROR is located here, it returns TYPE_MOBILE :s
                Log.v(TAG, "   type is not TYPE_MOBILE_MMS, bail");
                return;
            }
        }
        ...

As you can see in the comment, mNetworkInfo.getType() returns TYPE_MOBILE but I expect TYPE_MOBILE_MMS.

So, my question is the following: Did I make something wrong ? Or, Is there another way to do that ?

Ps: It works on devices running Android 2.3 to 3.2 and 4.1 and above.

  • 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-17T19:27:55+00:00Added an answer on June 17, 2026 at 7:27 pm

    It appears on some devices, with some providers, the TYPE_MOBILE isn’t the default MMS gateway, you have to use another one. Here is the solution I found that solved my problem.

    I hope this could help someone else.

    // Take a wake lock so we don't fall asleep before the message is downloaded.
    createWakeLock();
    
    // Let's try every type
    int result = -1;
    int[] apnTypes = new int[] {ConnectivityManager.TYPE_MOBILE, ConnectivityManager.TYPE_MOBILE_MMS, ConnectivityManager.TYPE_MOBILE_DUN, ConnectivityManager.TYPE_MOBILE_HIPRI, ConnectivityManager.TYPE_MOBILE_SUPL};
    for (int i=0; i<apnTypes.length; i++)
    {
        result = mConnMgr.startUsingNetworkFeature(apnTypes[i], PhoneEx.FEATURE_ENABLE_MMS);
        Log.v(TAG, "beginMmsConnectivity: result=" + result);
        switch (result)
        {
            case PhoneEx.APN_ALREADY_ACTIVE:
            case PhoneEx.APN_REQUEST_STARTED:
                acquireWakeLock();
                return result;
        }
    }
    
    // None found
    throw new IOException("Cannot establish MMS connectivity");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on an Android application that will send MMS internally without using the
Hi I want to send an MMS through my application.For that my code is
I want to send an Application Key Presses, To Automate some stuff that has
I cannot figure out how to send an encrypted MMS message using the Android
I want send e-mail with some images in content. I think I must attached
I want to send SMS using LWUIT. what class should i be looking at?
I'm using the following piece of code in Android to send a mail: Intent
I want send some data to a remote webpage from my site. Actually it
I want to send mms through iphone. i search a lot but failed Please
I want to attach audio file to MMS.How to do that?I found a lot

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.