安卓:注册应用程序发送/编写短信 [英] Android: register application to Send/Compose sms

查看:158
本文介绍了安卓:注册应用程序发送/编写短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何注册我的应用程序,这样,当我preSS撰写短信按钮,甚至连使用发送短信出现在我的应用程序在对话框中完成操作?我已经把那个code到清单文件(注意NewMessageActivity发送短信),但它不工作。

How can I register my application so that when I press compose sms button or even send sms my app appears in dialog Complete action using ? I have put that code to Manifest file (note NewMessageActivity sends sms) but it's not working.

    <activity
        android:name=".NewMessageActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />

            <action android:name="android.intent.action.SENDTO" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data android:mimeType="text/plain" />
            <data android:scheme="sms" />
            <data android:scheme="smsto" />
        </intent-filter>
    </activity>

任何帮助吗?有什么建议么 ?谢谢!

Any help ? Any suggestions ? Thanks !

推荐答案

所以,我终于找到了下面的链接<一个正确的答案href=\"http://stackoverflow.com/questions/4257045/android-register-application-to-receive-sms\">android:注册申请接收短信

So I finally found the right answer in the following link android: register application to receive sms

<activity
        android:name="az.elman.grouptextfree.NewMessageActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />                
            <data android:mimeType="vnd.android-dir/mms-sms" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <action android:name="android.intent.action.SENDTO" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="sms" />
            <data android:scheme="smsto" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="text/plain" />
        </intent-filter>
    </activity>

另外,不要忘了添加此权限&LT;使用许可权的android:NAME =android.permission.SEND_SMS/&GT;
你的清单文件作为Jbad26写道。

Also do not forget to add this permission <uses-permission android:name="android.permission.SEND_SMS"/> to your Manifest file as Jbad26 wrote.

这篇关于安卓:注册应用程序发送/编写短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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