Click here to Skip to main content
15,868,016 members
Articles / Programming Languages / Visual Basic

Skypekit.NET

Rate me:
Please Sign up or sign in to vote.
4.86/5 (17 votes)
15 Feb 2012CPOL3 min read 130.9K   44   44
Skypekit API for .NET

Download

Skypekit API and Tutorials

Introduction

Some developers today tend to use Skypekit in their applications to make it more interactive with the user. Skype API is very awesome indeed but the problem is it is only available in C++, Java and Python. I can't understand why Microsoft didn't develop API for .NET so we can develop it in C# or VB.NET.

I'm one of those, I needed to embed Skype into my graduation project and after I paid the 5$ fees and downloaded the SDK and Runtime I was surprised when I found that there is no support for the .NET languages.

So, the only way I found is to convert C++ methods into a COM component then I can call it in C# using DLLImport. And I spent weeks trying to do this solution but all in vain.

A punch of errors came to my face when I tried to create a new C++ project away from their pre-made tutorials. I was very sad with this result.

I tried to do it in Python but for some reason the socket couldn't make the connection to Skype.

Then I found the magic tool IKVM.

Background

IKVM is a tool that is used to convert Java Applications to .NET Executables (.exe) and Assemblies (.dll).

I used it to convert the Skype Class in their ready-made Java Classes into a .NET 'skypekit' class

Then I manually converted all the Java utilities Code to their corresponding C# code including:

  • AppKeyPairMgr Class
  • Listeners Class
  • MySession Class
  • ParseSkypeKitVersion Class
  • PrintStream Class
  • SignInMgr Class
  • XmlStrMgr Class

And I added an additional Class containing the variables needed and the two main variables which are:

  • myAppKeyPairMgr
  • mySession

I then managed to use Skypekit in my C# application very easy and I could access all its features.

In the uploaded project I included all the 12 Java tutorials done in C# to assure that my .NET DLL is working.

Using the code

To use it, First you have to add the following references:
  1. IKVM.OpenJDK.Core.dll : Java main classes converted to .NET
  2. IKVM.OpenJDK.Security.dll : Java Security Classes (needed for the PrivateKey Class and X509Certificate Class)
  3. IKVM.OpenJDK.Text.dll (Rarely Needed) : Needed for the DateFormat Class
  4. IKVM.Runtime.dll : IKVM Runtime libraries
  5. skypekit.dll : Skype Main Class converted from Java Jar Application using IKVM
  6. Skypekit.NET.dll : My classes created manually based on Java classes

And this is an example of a C# code To make Login

C#
public SkypeMain skypeMain;
public void Login(string user, string pass)
        {
            skypeMain = new SkypeMain();
            if ((!skypeMain.myAppKeyPairMgr.resolveAppKeyPairPath()) ||
                (!skypeMain.myAppKeyPairMgr.isValidCertificate()))
            {
                return;
            }

            skypeMain.mySession.doCreateSession(skypeMain.MY_CLASS_TAG, user, skypeMain.myAppKeyPairMgr.getPemFilePathname());

            if (skypeMain.mySession.mySignInMgr.Login(skypeMain.MY_CLASS_TAG, skypeMain.mySession, pass))
            {
                //Do Something
            }
        }

Remember to Do these step before running any Skype application.

  1. Download your Keypair (*.pem)
  2. execute
    openssl pkcs8 -topk8 -nocrypt -inform PEM -outform DER -in myKeyPair.pem -out myKeyPair.der 

    to create the certificate file (*.dem)
  3. [Optional] Change the variable KEY_PAIR_DEFAULT_PATHNAME in AppKeyPairMgr class to the path of your .pem keypair file to make it a constant in your app and then re-build the library. Or you can just pass the file path in the main arguments.
  4. Make sure that skype runtime console is running before you run your app.

Points of Interest

I learnt a lot from this painful experiences. So, I need you to know that every problem has a solution but needs some patience and deep thinking.

I reached this powerful and complete solution after weeks of search and thinking.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead Paymob Solutions
Egypt Egypt
Educated at Computer Science & Information College, Mansoura University, Egypt
Set up a software development company "Perfect Code" which was in the name "Ahmedn1" or "AN1Soft"

Working with:
C#, VB.NET, ASP.NET, PHP, Windows Phone applications, Java, Python

My quote in life is
To Be Or Not To Be

Comments and Discussions

 
GeneralRe: .pem file Pin
Ahmedn15-Jun-13 16:56
Ahmedn15-Jun-13 16:56 
GeneralRe: .pem file Pin
p_m_durrant24-Jun-13 0:55
p_m_durrant24-Jun-13 0:55 
GeneralRe: .pem file Pin
Ahmedn126-Jun-13 0:01
Ahmedn126-Jun-13 0:01 
GeneralRe: .pem file Pin
Ross Presser19-Jul-13 9:14
Ross Presser19-Jul-13 9:14 
QuestionText Chat using Skypekit Pin
thirusns10-Aug-12 1:55
thirusns10-Aug-12 1:55 
AnswerRe: Text Chat using Skypekit Pin
Ahmedn116-Oct-12 14:45
Ahmedn116-Oct-12 14:45 
QuestionC++/CLI ? Pin
Dumitru Frunza17-May-12 9:01
Dumitru Frunza17-May-12 9:01 
QuestionSpeech-Suport only? No Video correct? Pin
SebastianUw6-May-12 23:44
SebastianUw6-May-12 23:44 
Hi there,

i tried it and it is an really really good project.

Only one big disadvantage... it do not support video, only speech conversation. Is that correct or do i a mistake.

Thanks for reply!
AnswerRe: Speech-Suport only? No Video correct? Pin
Ahmedn18-May-12 13:23
Ahmedn18-May-12 13:23 
AnswerRe: Speech-Suport only? No Video correct? Pin
Ahmedn18-May-12 13:24
Ahmedn18-May-12 13:24 
QuestionCant find skypekit.dll or skypekit.NET.dll Pin
Alan Kidd27-Apr-12 10:00
Alan Kidd27-Apr-12 10:00 
AnswerRe: Cant find skypekit.dll or skypekit.NET.dll Pin
Ahmedn18-May-12 13:25
Ahmedn18-May-12 13:25 
Questionerrors Pin
Member 867747825-Feb-12 10:24
Member 867747825-Feb-12 10:24 
AnswerRe: errors Pin
Ahmedn126-Feb-12 4:47
Ahmedn126-Feb-12 4:47 
QuestionCool did not know IKMV Pin
Nicolas Dorier15-Feb-12 20:58
professionalNicolas Dorier15-Feb-12 20:58 
AnswerRe: Cool did not know IKMV Pin
Ahmedn117-Feb-12 16:38
Ahmedn117-Feb-12 16:38 
GeneralMy vote of 5 Pin
Аslam Iqbal15-Feb-12 20:19
professionalАslam Iqbal15-Feb-12 20:19 
QuestionKeep it up... Pin
aamironline15-Feb-12 16:44
aamironline15-Feb-12 16:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.