从其他应用程序打开聊天屏幕Skype

时间:2012-08-14 05:51:51

标签: android skype skypedeveloper

开发一个应用程序,其中我有很多用户的account_id(skype id),现在我想要的是当我从我的应用程序中点击特定用户的skype_id时打开Skype的聊天屏幕(已安装在设备中)。

我在网上搜索但没有成功 得到了如何在Skype上开始通话但是聊天的链接?

1) Link 1

2) Link 2

2 个答案:

答案 0 :(得分:3)

您可以使用Skype URI Scheme(Skype:echo123?聊天)。

您可以在此处找到有关URI方案的更多信息:https://dev.skype.com/skype-uri

由于

艾伦史密斯 Skype开发人员支持经理

答案 1 :(得分:1)

以下是打开Skype聊天对话的代码:

  private void openSkype(Context context) {

  // Make sure the Skype for Android client is installed
        if (!isSkypeClientInstalled(context)) {
            goToMarket(context);

            return;
        }

        final String mySkypeUri = "skype:echo123?chat";
                    // Create the Intent from our Skype URI.
                    Uri skypeUri = Uri.parse(mySkypeUri);
                    Intent myIntent = new Intent(Intent.ACTION_VIEW, skypeUri);

                    // Restrict the Intent to being handled by the Skype for Android client only.
                myIntent.setComponent(new ComponentName("com.skype.raider", "com.skype.raider.Main"));
                myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        try {
                    context.startActivity(myIntent);
                } catch (Exception e) {
                    e.printStackTrace();
                }
    }

/**
     * Determine whether the Skype for Android client is installed on this device.
     */
    public boolean isSkypeClientInstalled(Context myContext) {
        PackageManager myPackageMgr = myContext.getPackageManager();
        try {
            myPackageMgr.getPackageInfo("com.skype.raider", PackageManager.GET_ACTIVITIES);
        } catch (PackageManager.NameNotFoundException e) {
            return (false);
        }
        return (true);
    }

/**
     * Install the Skype client through the market: URI scheme.
     */
    public void goToMarket(Context myContext) {
        Uri marketUri = Uri.parse("market://details?id=com.skype.raider");
        Intent myIntent = new Intent(Intent.ACTION_VIEW, marketUri);
        myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        myContext.startActivity(myIntent);
    }
相关问题