短信原料PDU Android中 [英] SMS raw pdu in Android

查看:255
本文介绍了短信原料PDU Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1)有没有办法,我可以从Android设备发送原始的短信PDU什么办法?

1) Is there any way that I can send a raw SMS PDU from an Android device?

或者

2)是否有任何可用的类,可以给我访问PDU头(例如TP-DCS),这样我可以构建PDU,因为我喜欢?

2) are there any classes available that can give me access to the PDU headers (for example TP-DCS) so that I can construct the PDU as I like?

我已经搜查了网,发现: <一href="http://www.androidjavadoc.com/1.0_r1_src/com/android/internal/telephony/gsm/ISms.html">http://www.androidjavadoc.com/1.0_r1_src/com/android/internal/telephony/gsm/ISms.html 但上面的类是专用的,因此不能提供给我(还没有真正明白为什么)。

I have searched the net and found: http://www.androidjavadoc.com/1.0_r1_src/com/android/internal/telephony/gsm/ISms.html but the above classes are private and as such are not available to me(haven't actually understood why).

是我在问什么可能以任何方式或不?如果没有,那么为什么我不能有那种functionallity的?

Is what I'm asking possible in any way or not? If not then why can't I have that kind of functionallity?

感谢名单

推荐答案

这是一个的要求功能的公共API。

This is a requested feature for the public API.

开发者评论暗示使用 sendRawPdu 从内部 SMSDispatcher API,它可以通过<一做HREF =htt​​p://www.tutorialforandroid.com/2009_11_01_archive.html>反射。然而,使用私人API,用于生产code强烈建议不要

The developer comments hint at using the sendRawPdu from the internal SMSDispatcher API, which can be done via reflection. However, the use of private APIs for production code is highly discouraged

目前尚不清楚是否有可能使用公共 TelephonyManager API发送。

It is not clear if it's possible to send using the public TelephonyManager API.

/*
 * 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) {

在结论: 目前尚不清楚是否有可能。我有同样的问题,你。

In conclusion: It's not clear if it's possible. I have the same question as you.

这篇关于短信原料PDU Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆