Click here to Skip to main content
11,412,516 members (66,307 online)
Click here to Skip to main content

Tagged as

Skypekit.NET

, 15 Feb 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
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

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)

Share

About the Author

Ahmedn1
CEO Perfect Codes
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
Follow on   Twitter

Comments and Discussions

 
Questioni want to know about keypair ? and how to change it Pin
Member 9332293 at 27-Feb-15 23:29
memberMember 933229327-Feb-15 23:29 
QuestionDownload your Keypair (*.pem) Pin
vantypro at 22-Sep-14 5:25
membervantypro22-Sep-14 5:25 
AnswerRe: Download your Keypair (*.pem) Pin
Ahmedn1 at 5-Nov-14 12:48
memberAhmedn15-Nov-14 12:48 
GeneralRe: Download your Keypair (*.pem) Pin
vantypro at 5-Nov-14 16:30
membervantypro5-Nov-14 16:30 
AnswerRe: Download your Keypair (*.pem) Pin
Miklo B at 18-Jan-15 13:27
memberMiklo B18-Jan-15 13:27 
GeneralRe: Download your Keypair (*.pem) Pin
Ahmedn1 at 14-Feb-15 10:49
memberAhmedn114-Feb-15 10:49 
QuestionGreat and Hard Job was Put on this amazing App! Pin
Miklo B at 6-Apr-14 15:21
memberMiklo B6-Apr-14 15:21 
AnswerRe: Great and Hard Job was Put on this amazing App! Pin
Ahmedn1 at 3-Jul-14 14:40
memberAhmedn13-Jul-14 14:40 
GeneralRe: Great and Hard Job was Put on this amazing App! Pin
Miklo B at 21-Aug-14 18:20
memberMiklo B21-Aug-14 18:20 
QuestionSkype not allowing new developers. Pin
Ravuri Vasu at 1-Sep-13 8:19
memberRavuri Vasu1-Sep-13 8:19 
AnswerRe: Skype not allowing new developers. Pin
Ahmedn1 at 1-Sep-13 12:50
memberAhmedn11-Sep-13 12:50 
Questionskype keypair alternative Pin
p_m_durrant at 23-Apr-13 5:00
memberp_m_durrant23-Apr-13 5:00 
QuestionEgyptians rule dude :D Pin
Poma37 at 11-Feb-13 7:31
memberPoma3711-Feb-13 7:31 
QuestionKeypair making Pin
kalpesh2804 at 20-Nov-12 21:34
memberkalpesh280420-Nov-12 21:34 
AnswerRe: Keypair making Pin
Ahmedn1 at 21-Nov-12 21:07
memberAhmedn121-Nov-12 21:07 
GeneralRe: Keypair making Pin
mwechter at 31-Dec-12 13:45
membermwechter31-Dec-12 13:45 
GeneralRe: Keypair making Pin
Ahmedn1 at 23-Jan-13 13:20
memberAhmedn123-Jan-13 13:20 
Questionskypekit.NET in Web MVC? Pin
Member 2356977 at 21-Sep-12 10:17
memberMember 235697721-Sep-12 10:17 
AnswerRe: skypekit.NET in Web MVC? Pin
Ahmedn1 at 16-Oct-12 15:42
memberAhmedn116-Oct-12 15:42 
Question.pem file Pin
Soheil Mehralian at 10-Sep-12 7:20
memberSoheil Mehralian10-Sep-12 7:20 
AnswerRe: .pem file Pin
Ahmedn1 at 16-Oct-12 15:44
memberAhmedn116-Oct-12 15:44 
QuestionRe: .pem file Pin
p_m_durrant at 22-Apr-13 4:54
memberp_m_durrant22-Apr-13 4:54 
AnswerRe: .pem file Pin
Ahmedn1 at 29-May-13 12:01
memberAhmedn129-May-13 12:01 
GeneralRe: .pem file Pin
p_m_durrant at 2-Jun-13 23:52
memberp_m_durrant2-Jun-13 23:52 
GeneralRe: .pem file Pin
Ahmedn1 at 5-Jun-13 17:56
memberAhmedn15-Jun-13 17:56 
GeneralRe: .pem file Pin
p_m_durrant at 24-Jun-13 1:55
memberp_m_durrant24-Jun-13 1:55 
GeneralRe: .pem file Pin
Ahmedn1 at 26-Jun-13 1:01
memberAhmedn126-Jun-13 1:01 
GeneralRe: .pem file Pin
Ross Presser at 19-Jul-13 10:14
memberRoss Presser19-Jul-13 10:14 
QuestionText Chat using Skypekit Pin
thirusns at 10-Aug-12 2:55
memberthirusns10-Aug-12 2:55 
AnswerRe: Text Chat using Skypekit Pin
Ahmedn1 at 16-Oct-12 15:45
memberAhmedn116-Oct-12 15:45 
QuestionC++/CLI ? Pin
Dumitru Frunza at 17-May-12 10:01
memberDumitru Frunza17-May-12 10:01 
QuestionSpeech-Suport only? No Video correct? Pin
SebastianUw at 7-May-12 0:44
memberSebastianUw7-May-12 0:44 
AnswerRe: Speech-Suport only? No Video correct? Pin
Ahmedn1 at 8-May-12 14:23
memberAhmedn18-May-12 14:23 
AnswerRe: Speech-Suport only? No Video correct? Pin
Ahmedn1 at 8-May-12 14:24
memberAhmedn18-May-12 14:24 
QuestionCant find skypekit.dll or skypekit.NET.dll Pin
Alan Kidd at 27-Apr-12 11:00
memberAlan Kidd27-Apr-12 11:00 
AnswerRe: Cant find skypekit.dll or skypekit.NET.dll Pin
Ahmedn1 at 8-May-12 14:25
memberAhmedn18-May-12 14:25 
Questionerrors Pin
Member 8677478 at 25-Feb-12 11:24
memberMember 867747825-Feb-12 11:24 
AnswerRe: errors Pin
Ahmedn1 at 26-Feb-12 5:47
memberAhmedn126-Feb-12 5:47 
QuestionCool did not know IKMV Pin
Nicolas Dorier at 15-Feb-12 21:58
memberNicolas Dorier15-Feb-12 21:58 
Ingenious and interesting way to migrate code from one language to another... the simpler the better !

I did not vote because your article is too short but it would be a cool trick.
AnswerRe: Cool did not know IKMV Pin
Ahmedn1 at 17-Feb-12 17:38
memberAhmedn117-Feb-12 17:38 
GeneralMy vote of 5 Pin
Аslam Iqbal at 15-Feb-12 21:19
memberАslam Iqbal15-Feb-12 21:19 
QuestionKeep it up... Pin
aamironline at 15-Feb-12 17:44
memberaamironline15-Feb-12 17:44 
QuestionMessage Automatically Removed Pin
at 15-Feb-12 16:53
groupghjtyktyk15-Feb-12 16:53 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150427.1 | Last Updated 16 Feb 2012
Article Copyright 2012 by Ahmedn1
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid