Sending mms in android 4.4

后端 未结 3 982
既然无缘
既然无缘 2020-12-21 20:30

I\'m trying to send mms from my app only. I made it default messaging app with help of android developers tutorial (http://android-developers.blogspot.com/2013/10/getting-yo

3条回答
  •  一生所求
    2020-12-21 21:05

    Easiest way i found for sending mms is android-smsmms library found here: https://github.com/klinker41/android-smsmms

    For gettings mmsc, proxy and port i used:

     final Cursor apnCursor = SqliteWrapper.query(mContext, this.mContext.getContentResolver(),
                    Uri.withAppendedPath(Telephony.Carriers.CONTENT_URI, "current"), APN_PROJECTION, null, null, null);
            String type = null;
            if (apnCursor.moveToFirst()) {
                do {
                    type = apnCursor.getString(3);
                    if(type.equals("default,supl,mms") ||
                            type.equals("mms")) {
                        mmsc = apnCursor.getString(0);
                        proxy = apnCursor.getString(1);
                        port = apnCursor.getString(2);
    }while (apnCursor.moveToNext());
    

    In if loop i am checking if APN has MMS data that i need otherwise go to next one.

提交回复
热议问题