java android.provider.Telephony 怎么了?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/499528/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What happened to android.provider.Telephony?
提问by Tatyana Solovyeva
Does anyone know what happened to android.provider.Telephony? It is not there anymore.
有谁知道发生了什么事android.provider.Telephony?它不存在了。
回答by Brian Gianforcaro
If you read thispost from the android-developer mailing list you can see that android.provider.Telephonyis part of the Open Source releases, but never included as part of the Official SDK.
如果您从 android-developer 邮件列表中阅读这篇文章,您会发现它android.provider.Telephony是开源版本的一部分,但从未包含在官方 SDK 中。
Meaning you are free to view it, to gain a understanding of how the underlying system works, but you can't actually reference and compile against it in your Android application(s).
这意味着您可以自由查看它,以了解底层系统的工作原理,但您实际上无法在您的 Android 应用程序中引用和编译它。
回答by Tatyana Solovyeva
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:
在 Chris Haseman 的 Apress (ISBN: 978-1-43021-064-1) 摘录中,它也被使用:
Telephony class is used for sms messaging,
(Context context, Intent intent) { SmsMessage msg[] = Telephony.Sms.Intents.getMessagesFromIntent(intent); ...
电话类用于短信,
(Context context, Intent intent) { SmsMessage msg[] = Telephony.Sms.Intents.getMessagesFromIntent(intent); ...
回答by Brian Gianforcaro
The code you linked to on anddev.org is for SDK version m5-rc14which is from February, 2008 almost an entire year old. The current SDK version is 1.0, with two releases between it and m5-rc14.
您在 anddev.org 上链接的代码适用于 SDK 版本m5-rc14,该版本距 2008 年 2 月几乎整整一年。当前的 SDK 版本是 1.0,在它和 m5-rc14 之间有两个版本。
Given the nature of the Android project they have added and removed many interfaces in its rapid growth/adoption. A lot of people have complained that they are closing out some of the interfaces to some cool parts of the operating system, such as the Telephony interface.
鉴于 Android 项目的性质,他们在其快速增长/采用过程中添加和删除了许多接口。很多人抱怨说他们关闭了操作系统一些很酷的部分的一些接口,例如电话接口。
You can check out android.telephony (link) package and see if there is equivalent functionality there.
您可以查看 android.telephony ( link) 包,看看那里是否有等效的功能。
回答by azelez
You can also use it to get data from your current reception signal. Check this tutorial- it uses the telephony manager to get data.
您还可以使用它从当前接收信号中获取数据。检查本教程- 它使用电话管理器来获取数据。
回答by haseman
I was able to send an SMS message with the G1 using the following library: android.telephony.gsm.SmsManager
我能够使用以下库通过 G1 发送 SMS 消息:android.telephony.gsm.SmsManager
So at least (for the SMS send/receive code) there is an equivalent library available.
所以至少(对于 SMS 发送/接收代码)有一个等效的库可用。
Also be sure to check out the TelephonyManager http://code.google.com/android/reference/android/telephony/TelephonyManager.html
另外一定要查看 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.
至于上面答案中的APress book reference,我写的。截至目前,它有点过时(它是在 1.0 SDK 发布之前发布的),我几乎完成了更新。啊,快速更新技术的乐趣。

