0

I am trying to send MMS programatically by using the post How to send image via MMS in Android? ....

I am trying to retrieve the APN values MMSC, MMSProxy and MMSPort , but I am getting empty values for the MMSProxy and MMSPort.. then I checked for these values in my HTC device by navigating "Settings-->Wireless&Networks-->MobileNetworks-->AccessPointNames-->MMS-->" but here actually nothing is was set for MMSProxy and MMSPort.... but I am able to send MMS manually..
Please help me in how to get MMSProxy and MMSPort values.. or plz tell me if built-in MMS application will use any other mechanism to send MMS..??

plz help me in this...

Community
  • 1
  • 1
brig
  • 305
  • 2
  • 6
  • 12
  • I am having problems even getting the APNs http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-mms-in-android – Etienne Lawlor Mar 09 '13 at 20:44

1 Answers1

0

It might not matter, proxy can mean an "alternate" route. maybe sending MMS doesn't need an alternate route so it's null?

the built in MMS app uses a class called TransactionSettings.java and that class queries the Telephony content provider, code excerpt.

public TransactionSettings(Context context, String apnName) {
    String selection = (apnName != null) ? APN + "='" + apnName.trim() + "'" : null;

    Cursor cursor = SqliteWrapper.query(context, context.getContentResolver(), Uri.withAppendedPath(Uri.parse(TELEPHONY_CONTENT_URI), "current"),
            APN_PROJECTION, selection, null, null);

    if (cursor == null) {
        Log.e(TAG, "Apn is not found in Database!");
        return;
    }

    boolean sawValidApn = false;
    try {
        while (cursor.moveToNext() && TextUtils.isEmpty(mServiceCenter)) {
            // Read values from APN settings
            if (isValidApnType(cursor.getString(COLUMN_TYPE), APN_TYPE_MMS)) {
                sawValidApn = true;
                mServiceCenter = cursor.getString(COLUMN_MMSC).trim();
                mProxyAddress = cursor.getString(COLUMN_MMSPROXY);
                if (isProxySet()) {
                    String portString = cursor.getString(COLUMN_MMSPORT);
                    try {
                        mProxyPort = Integer.parseInt(portString);
                    } catch (NumberFormatException e) {
                        if (TextUtils.isEmpty(portString)) {
                            Log.w(TAG, "mms port not set!");
                        } else {
                            Log.e(TAG, "Bad port number format: " + portString, e);
                        }
                    }
                }
            }
        }
    } finally {
        cursor.close();
    }

That being said, I use this method and still get null values.

Maybe you had better luck?

Aaron
  • 323
  • 3
  • 10