【发布时间】: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;
}
}
【问题讨论】: