【问题标题】:eclipse code for skype video call用于Skype视频通话的eclipse代码
【发布时间】:2014-02-27 16:45:52
【问题描述】:

我正在寻找一个在 Android 上演示 Skype 视频通话的 Eclipse 示例项目。我从 Stack Overflow 尝试了许多 Skype 意图实现,但无法构建或运行项目。我是初学者,所以我需要一个可以导入的完整实现和项目,以及在 Eclipse 上执行此操作的说明。

以下代码显示了我的应用的当前状态:

package com.example.newpro;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.view.Menu;
import android.view.View;

public class MainActivity extends Activity
{
    public void sendMessage(View view)
    {
        Intent skypeIntent = new Intent(Intent.ACTION_VIEW);
        String contactUserName="nithya92";

        skypeIntent.setData(Uri.parse("skype:" + contactUserName + 
            "?call&video=true"));

        //make call only then use  bellow given code
        //skypeIntent.setData(Uri.parse("skype:" + contactUserName+ "?call"));

        skypeIntent.setComponent(new ComponentName("com.skype.raider",
            "com.skype.raider.Main"));
        skypeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        MainActivity.this.startActivity(skypeIntent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu)
    {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
}

【问题讨论】:

    标签: java android skype


    【解决方案1】:
    public class MainActivity extends Activity {
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        final Button skype=(Button)findViewById(R.id.skypevideocall);
        final EditText edit = (EditText)findViewById(R.id.editText1);
    
          // Skype Video call button click event code here
          skype.setOnClickListener(new OnClickListener()
          {
           @Override
           public void onClick(View v)
           {
             String skypeName = edit.getText().toString();
             if(skypeName.length()< 6)
             Toast.makeText(getApplicationContext(), "Invalid Username:Minimun 6 Character",Toast.LENGTH_LONG).show();
    
    
             Uri skypeUri = Uri.parse("skype:"+skypeName+"?call&video=true");
             Intent myIntent = new Intent(Intent.ACTION_VIEW);
             myIntent.setData(skypeUri);
             startActivity(myIntent);
           }
          });
    
    
    
    }
    
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    

    在清单文件中添加以下详细信息,

    <intent-filter> 
         <action android:name="android.intent.action.MAIN" /> 
         <category android:name="android.intent.category.LAUNCHER" /> 
         <action android:name="android.intent.action.CALL_PRIVILEGED" />
         <category android:name="android.intent.category.DEFAULT" /> 
     </intent-filter>
    

    【讨论】:

    • 在manifest文件中添加如下细节,
    猜你喜欢
    • 2013-07-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多