Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4)

前端 未结 6 707
悲&欢浪女
悲&欢浪女 2020-11-21 22:51

I have figured out how to send and receive SMS messages. To send SMS messages I had to call the sendTextMessage() and sendMultipartTextMessage() m

6条回答
  •  Happy的楠姐
    2020-11-21 22:56

    To send an mms for Android 4.0 api 14 or higher without permission to write apn settings, you can use this library: Retrieve mnc and mcc codes from android, then call

    Carrier c = Carrier.getCarrier(mcc, mnc);
    if (c != null) {
        APN a = c.getAPN();
        if (a != null) {
            String mmsc = a.mmsc;
            String mmsproxy = a.proxy; //"" if none
            int mmsport = a.port; //0 if none
        }
    }
    

    To use this, add Jsoup and droid prism jar to the build path, and import com.droidprism.*;

提交回复
热议问题