package org.digitalsoft.android.test;

import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class CallMaker {
	public static void skype(String targetContact, Context context) throws ActivityNotFoundException {
		Intent intent = new Intent("android.intent.action.VIEW");
		String URI = "skype:" + targetContact + "?chat";
		intent.setData(Uri.parse(URI));
		context.startActivity(intent);
	}
	
	public static void viber(String targetContact, Context context) {
		Intent intent = new Intent("android.intent.action.VIEW");
		intent.setClassName("com.viber.voip", "com.viber.voip.WelcomeActivity");
		Uri uri = Uri.parse("tel:" + Uri.encode(targetContact)); 
		intent.setData(uri); 
		context.startActivity(intent);
	}


	public static void dilaer(String targetContact, Context context) {
		Intent intent = new Intent(Intent.ACTION_CALL);
		String URI = "tel:" + targetContact;
		intent.setData(Uri.parse(URI));
		context.startActivity(intent);
	}
	
	
	public static void sms(String targetContact, Context context) {		
		Intent smsIntent = new Intent(Intent.ACTION_SENDTO);
		smsIntent.addCategory(Intent.CATEGORY_DEFAULT);
		smsIntent.setType("vnd.android-dir/mms-sms");
		smsIntent.setData(Uri.parse("sms:" + targetContact));
		context.startActivity(smsIntent);	
	}

	
	public static void email(String targetContact, Context context) {
		Intent intent = new Intent(Intent.ACTION_VIEW);
		String URI = "mailto:" + targetContact;
		Uri data = Uri.parse(URI);
		intent.setData(data);
		context.startActivity(intent);
	}

}

@@ -1224,60 +1224,19 @@
 .set
-Type(%22vnd.android-dir/mms-sms%22);%0A%09%09smsIntent.setData
+DataAndType
 (Uri
@@ -1265,16 +1265,43 @@
 Contact)
+, %22vnd.android-dir/mms-sms%22
 );%0A%09%09con

Update CallMaker.java