How to start a Skype call from an Android app?

前端 未结 4 868
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 06:33

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

4条回答
  •  没有蜡笔的小新
    2020-12-03 06:56

    See this answer: https://stackoverflow.com/a/8844526/819355

    Jeff suggests using a skype: instead of tel:

    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);
            }
    
        }
    

提交回复
热议问题