从一个应用程序编程与放大器启动Skype的;传递号 - 机器人 [英] Launch Skype from an App Programmatically & Pass Number - Android

查看:107
本文介绍了从一个应用程序编程与放大器启动Skype的;传递号 - 机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试推出并通过电话。没有。从我的应用程序这个code Skype的:

Trying to launch and pass tel. no. to skype by this code from my app:

PackageManager packageManager = getPackageManager();
Intent skype = packageManager.getLaunchIntentForPackage("com.skype.raider");
skype.setData(Uri.parse("tel:65465446"));
startActivity(skype);

Skype正在启动,但它无法赶上的数量。

Skype is launched but it can't catch the number.

推荐答案

这code工作对我来说,启动两个Skype用户之间的呼叫:

This code works for me to start a call between two Skype users:

Intent sky = new Intent("android.intent.action.VIEW");
sky.setData(Uri.parse("skype:" + user_name));
startActivity(sky);

要找到这个(及其他),使用apktool打开Skype的APK。看AndroidManifest.xml中,你会看到他们所了解的意图过滤器。如果要触发这些意图过滤器中的一个,你需要做的意图,将匹配之一。这里的意图过滤器中,code以上是匹配:

To find this (and others), use apktool to open up the Skype APK. Look at the AndroidManifest.xml and you'll see all the intent filters they know about. If you want to trigger one of those intent filters, you need to make an intent that will match one. Here's the intent filter that the code above is matching:

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="skype" />
        </intent-filter>

您获得类别android.intent.category.DEFAULT免费从{{新意图()}},因此,所有剩下的工作就是设置动作和URI。

You get the category "android.intent.category.DEFAULT" for free from {{new Intent()}}, so all that remains is to set the action and the URI.

的意图过滤器的电话:URI的是这样的:

The intent filter for tel: URIs looks like this:

        <intent-filter android:icon="@drawable/skype_blue" android:priority="0">
            <action android:name="android.intent.action.CALL_PRIVILEGED" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="tel" />
        </intent-filter>

所以,你设定的动作,给意图电话:URI和一切都很好。什么情况是,Android的找到正确的提供者电话:URI。它可能会得到用户的输入到手机应用程序和Skype之间进行选择。为Skype处理电话的优先级:URI的零,这是最低的。因此,如果安装了手机应用程序,它可能会获得的意图。

So you set to the action and give the Intent a tel: URI and "the right thing happens". What happens is that Android finds the correct provider for the tel: URI. It might get the user's input to choose between the Phone App and Skype. The priority for Skype to handle tel: URIs zero, which is lowest. So if the Phone App is installed, it will probably get the Intent.

这篇关于从一个应用程序编程与放大器启动Skype的;传递号 - 机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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