Kallasoft API installation
aostiles
Registered Users Posts: 3 Beginner grinner
Hello, I have eclipse set up for java development. However, I am new to writing java applications, and I am not sure how to use the kallasoft SmugMug Java API in eclipse. How would I use one of the methods in the API? I know I would have to import the class at the beginning of the code, but what I'm trying to say is how would eclipse know where to find the kallasoft api? Thanks in advance.
0
Comments
Standby, I'll get Riyad to answer personally.
Cheers,
David
SmugMug API Developer
My Photos
Getting started with Java programming can be a bit daunting. The first thing you need to do is right-click on your project, and go to Properties > Java Build Path > Libraries, click Add and add the API JAR.
The JAR is a bundle of all the classes, putting it on the build path like that allows Eclipse to find those classes for you.
Once you've done that, then you can literally work with any of the SmugMug methods by name -- as the kallasoft API maps the methods exposed by SmugMug to Java classes pretty much 1:1, here's an example:
http://www.kallasoft.com/smugmug-java-api/examples/
So the SmugMug API has a WithPassword login call that you use to login with a password, so in the Java API, you have the same. All the arguments are defined for you so you just create a new instance of WithPassword and use the execute method on it to call it.
The only part that might not be straight forward is the "apiKey", you have to login to your SmugMug account and generate one from the Control Panel.
I've created an example project for you here:
http://www.kallasoft.com/downloads/smugmug-java-api-example-project.zip
that you can import into Eclipse (File > Import > Existing Project > Archive...) and start immediately. It includes the libraries for the most current release of the API, and an example class that looks like this:
Let me know if you have any questions.
kallasoft | The "Break It Down" Blog