To requested cechą publicznych API.
Deweloper komentuje podpowiedź użycia sendRawPdu
z wewnętrznego interfejsu API SMSDispatcher
, co można wykonać przez reflection. Jednak korzystanie z prywatnych interfejsów API dla kodu produkcyjnego jest wysoce odradzane.
Nie jest jasne, czy możliwe jest wysyłanie przy użyciu publicznego interfejsu API TelephonyManager
.
/*
* TODO(cleanup): It looks like there is now no useful reason why
* apps should generate pdus themselves using these routines,
* instead of handing the raw data to SMSDispatcher (and thereby
* have the phone process do the encoding). Moreover, CDMA now
* has shared state (in the form of the msgId system property)
* which can only be modified by the phone process, and hence
* makes the output of these routines incorrect. Since they now
* serve no purpose, they should probably just return null
* directly, and be deprecated. Going further in that direction,
* the above parsers of serialized pdu data should probably also
* be gotten rid of, hiding all but the necessarily visible
* structured data from client apps. A possible concern with
* doing this is that apps may be using these routines to generate
* pdus that are then sent elsewhere, some network server, for
* example, and that always returning null would thereby break
* otherwise useful apps.
*/
/**
* Get an SMS-SUBMIT PDU for a destination address and a message
*
* @param scAddress Service Centre address. Null means use default.
* @return a <code>SubmitPdu</code> containing the encoded SC
* address, if applicable, and the encoded message.
* Returns null on encode error.
* @hide
*/
public static SubmitPdu getSubmitPdu(String scAddress,
String destinationAddress, String message,
boolean statusReportRequested, byte[] header) {
Podsumowując: Nie jest jasne, czy jest to możliwe. Mam takie samo pytanie jak ty.
Po tak długim czasie i po ponownym zalogowaniu się na moje konto. Dziękuję bardzo za odpowiedź! – zlinks