6

有谁知道发生了android.provider.Telephony什么?它已经不存在了。

4

5 回答 5

5

如果你从 android-developer 邮件列表中阅读这篇文章,你会发现它android.provider.Telephony是开源版本的一部分,但从未包含在官方 SDK 中。

这意味着您可以自由查看它,以了解底层系统的工作原理,但您实际上无法在您的 Android 应用程序中引用和编译它。

于 2009-01-31T20:57:59.713 回答
1

您在 anddev.org 上链接到的代码适用于 SDK 版本m5-rc14,该版本从 2008 年 2 月开始,几乎整整一年了。当前的 SDK 版本是 1.0,它和 m5-rc14 之间有两个版本。

鉴于 Android 项目的性质,他们在其快速增长/采用过程中添加和删除了许多接口。很多人抱怨他们正在关闭操作系统中一些很酷的部分的一些接口,例如电话接口。

您可以查看 android.telephony ( link ) 包,看看那里是否有等效的功能。

于 2009-02-01T03:29:19.143 回答
1

Thanks Brian, however, it seems Telephony is used by code posted on this site.

In this excerpt from Apress (ISBN: 978-1-43021-064-1) by Chris Haseman, it is used too:

Telephony class is used for sms messaging,

(Context context, Intent intent)
{
SmsMessage msg[] =
    Telephony.Sms.Intents.getMessagesFromIntent(intent);
...
于 2009-01-31T21:18:45.040 回答
1

您还可以使用它从当前接收信号中获取数据。查看本教程- 它使用电话管理器获取数据。

于 2010-06-03T05:22:40.013 回答
0

I was able to send an SMS message with the G1 using the following library: android.telephony.gsm.SmsManager

So at least (for the SMS send/receive code) there is an equivalent library available.

Also be sure to check out the TelephonyManager http://code.google.com/android/reference/android/telephony/TelephonyManager.html

This isn't exactly what you were asking about, but it does provide a lot of the functionality you're looking for.

As for the APress book reference in the answer above, I wrote it. As of right now, it's a little out of date (It was published before the 1.0 SDK was published) and I'm almost done updating it. Ahhh the joys of rapidly updating technology.

于 2009-02-06T23:15:35.203 回答