Rabu, 18 Agustus 2010

How To Install Google Blogger Java API

In this post I will tell you EXACTLY how to install Google's Blogger Java API. I covered How to Install WAMP, Java, Hibernate, and Eclipse at another post; therefore consult it if you want to know how to install any of those tools. In my personal project I installed all of them as well as Google's Blogger API for Java so that I can use Java to update my blog based on some business logic which involves pulling data out of a local MySQL database. Without further ado let's follow the following steps to install Google API!

Download the latest Blogger Java client library from Google's code download page. The version I am using is gdata-samples.java-1.41.5.zip.

Unzip the zipped file and the unzipped files should be in gdata\ folder.

Copy all jars in the following directories to your Java's extension directory (my Java's extension directory is C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\ext\). If you don't know why we are doing this consult How Java Recognizes Where Things Are. Basically you are trying to give Java access to Google Blogger Java API by copying those jars to your Java's extension folder. Here are the directories whose jars you should copy to Java extension folder:

* gdata\java\deps\
* gdata\java\lib\
* gdata\java\sample\util\lib\


There you go! Now you should be able to use Blogger API to programmatically update your blog rather than log into your account and update manually!

If you use Eclipse you should restart it so that it recognizes the newly added jars in your Java's extension folder.

If you are using a client library that's different than 1.41.3 it may have a different directory structure. Questions? Let me know! The jars in gdata\java\sample\util\lib are required to run their sample code at gdata\java\sample\blogger\BloggerClient.java. In this Java file you will learn how to use the API to create, read, update, delete a post. Trust me. The Blogger API is very easy to use and you'll get the hang of it in no time.

Throughout my stint with Blogger I've encountered and resolved many difficulties. They include how to add a label to a post via the API, how to tell the page type in template HTML, etc. So check out my posts at Blogger Category if you come across any issue! If you still have issues let me know! and I'll do my best to help!

0 komentar:

 
support by: infomediaku.com