如何开始从Android应用程序Skype通话? [英] How to start a Skype call from an Android app?

查看:91
本文介绍了如何开始从Android应用程序Skype通话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开始从我的Andr​​oid应用程序Skype的意图,传递一个电话号码。到目前为止,多亏了谁的广告similiar需要在这里计算器其他人,我已经成功地启动Skype,但我仍然无法通过电话号码。这是code我使用:

I'm trying to start a Skype intent from my Android App, passing a phone number. So far, thanks to other people who ad similiar needs here on stackoverflow, I've managed to start skype, but still I can't pass the phone number. This is the code I'm using:

Intent sky = new Intent("android.intent.action.CALL_PRIVILEGED");
        sky.setClassName("com.skype.raider",
                "com.skype.raider.Main");
        sky.setData(Uri.parse("tel:" + number));
        Log.d("UTILS", "tel:" + number);
        ctx.startActivity(sky);

发生了什么事是Skype的启动,但给了我举杯说这个号码是无效​​的,并建议我加国际preFIX。 该Log.d给我电话:+39 ........(数量的作品,我用它也为

What's happening is that skype starts, but gives me a toast saying that the number is not valid, and suggests me to add the international prefix. The Log.d gives me tel:+39........ (the number works, I'm using it also for

public static void call(String number, Context ctx) {
    try {
        Intent callIntent = new Intent(Intent.ACTION_CALL);
        callIntent.setData(Uri.parse("tel:" + number));
        ctx.startActivity(callIntent);
    } catch (ActivityNotFoundException e) {
        Log.e("helloandroid dialing example", "Call failed", e);
    }

}

其实,当我去到Skype的看法的电话,我看到它已经由+ 0 那么,在我看来是我要传递的电话号码以错误的方式,或以错误的活动....任何帮助将是非常美联社preciated! 在此期间,我只是想说,计算器简单的岩石。

In fact, when I go to the Skype's view for calling, I see it's been composed +0 So what it seems to me is that I'm passing the phone number in the wrong way, or to the wrong Activity....any help would be very appreciated! In the meantime, I just want to say that StackOverflow simply rocks.

推荐答案

看到这个答案: http://stackoverflow.com/a /八十一万九千三百五十五分之八百八十四万四千五百二十六

杰夫建议使用 SKYPE:<使用者名称> 而不是电话:<电话号码>

Skype的APK与apktool一些学习化后,作为这个问题的答案的建议,我想出了这个code,对我来说它的工作:

After some studing of the skype apk with apktool, as suggested in that answer, I came up with this code, for me it's working:

public static void skype(String number, Context ctx) {
        try {
            //Intent sky = new Intent("android.intent.action.CALL_PRIVILEGED");
            //the above line tries to create an intent for which the skype app doesn't supply public api

                Intent sky = new Intent("android.intent.action.VIEW");
            sky.setData(Uri.parse("skype:" + number));
            Log.d("UTILS", "tel:" + number);
            ctx.startActivity(sky);
        } catch (ActivityNotFoundException e) {
            Log.e("SKYPE CALL", "Skype failed", e);
        }

    }

这篇关于如何开始从Android应用程序Skype通话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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