如何从 android (phonegap) 上的 javascript 访问短信收件箱
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4507299/
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
How to access sms inbox from javascript on android (phonegap)
提问by naugtur
I just discovered PhoneGap and was wondering if there's a way to access the SMS inbox from Javascript with it. Or if there's another easy way to do it in an app created from a HTML/CSS/JS solution.
我刚刚发现了 PhoneGap,想知道是否有办法通过它从 Javascript 访问 SMS 收件箱。或者,如果有另一种简单的方法可以在从 HTML/CSS/JS 解决方案创建的应用程序中执行此操作。
There's no info about SMS access in the phonegap docs, but maybe the inbox is avaliable as a url or a folder?
在 phonegap 文档中没有关于 SMS 访问的信息,但也许收件箱可以作为 url 或文件夹使用?
I would like to stick with phonegap so that the app would work on many devices, but an android only solution is satisfactory too.
我想坚持使用 phonegap,以便该应用程序可以在许多设备上运行,但仅限 android 的解决方案也令人满意。
采纳答案by eeadev
There is a plugin for doing it with phonegap,
有一个插件可以用phonegap来做,
Take a look at SMS reception plugin for Phonegap
回答by davejohnson
This functionality is not currently in PhoneGap though it might come in a future release. This is something that whole community would probably appreciate!
此功能目前不在 PhoneGap 中,尽管它可能会在未来的版本中出现。这是整个社区可能会欣赏的东西!
I think you will want to create a plugin to achieve this functionality for the moment. Some examples of plugins are here: https://github.com/phonegap/phonegap-plugins.
我认为您暂时需要创建一个插件来实现此功能。一些插件示例如下:https://github.com/phonegap/phonegap-plugins。
Here is an example of using an Android ContentProvider to interact with the SMS inbox How to delete an SMS from the inbox in Android programmatically?
以下是使用 Android ContentProvider 与 SMS 收件箱交互的示例如何以编程方式从 Android 的收件箱中删除 SMS?

