Google API Hello World
来源:互联网 发布:amd vmware mac os 编辑:程序博客网 时间:2024/05/21 08:32
阅读下列文章
1. 用eclipse写google api client 程序 http://code.google.com/apis/gdata/articles/eclipse.html
2. 如何使用google document list API http://code.google.com/apis/documents/docs/3.0/developers_guide_java.html
3. 用其他语言写google api client 程序 http://code.google.com/apis/gdata/articles/
阅读完之后,下面写一个最简单的java例子:使用google api来获取你的google account里的document list
1. install eclipse and download google api for java "gdata-samples.java-xxx.zip" file at http://code.google.com/p/gdata-java-client/downloads/list, 解压该zip file (然后我会把"lib" and "deps" 目录下的jar files放到一起,例如放到一个gdata_lib目录下)
2. create new "java project" eclipse,然后把步骤1提到google api jar files添加到java build path library里,另外还需要用到下列3个jar:mail.jar, servlet-api.jar and activation.jar
3. create a simple class to use google api
import java.net.URL;import com.google.gdata.client.docs.DocsService;import com.google.gdata.data.docs.DocumentListEntry;import com.google.gdata.data.docs.DocumentListFeed;public class TestDocumentList {public static void main(String[] args) {DocsService client = new DocsService("document list demo");try {client.setUserCredentials("hkbu.chtl.tomson@gmail.com", "chtl2010");URL documentListFeedUrl = new URL("https://docs.google.com/feeds/default/private/full");DocumentListFeed feed = client.getFeed(documentListFeedUrl,DocumentListFeed.class);for (DocumentListEntry entry : feed.getEntries()) {System.out.println(entry.getTitle().getPlainText());}} catch (Exception e) {e.printStackTrace();}}}
4. run it!
- Google API Hello World
- HDFS API hello world
- HDFS API hello world
- Google 地图的“Hello, World”
- widows API 之 hello world
- Google Gadgets (1):从 Hello World 开始
- Google App Engine Hello World AppConfigNotFoundError 解决办法
- Google App Engine创建hello world
- Open XML API 之 Hello World
- Android API Demos学习(1) - Hello World
- Revit API 开发 (1): Hello World
- Hello World--------------LeapMotion API新建一个程序
- Hello World!【Hello World】
- 基于Google App Engine和Django的Hello World
- Google Maps 第 3 版的“Hello, World”
- Hello, world!
- Hello World!
- Hello world!
- 利用WebService自定义显示天气情况
- [转]Ultra Fractal教程系列51——动画功能的使用09——渲染动画
- shell使用正则表达式来验证数字字符
- Java多线程----Java 线程池的原理与实现
- Linux vi的一些操作笔记
- Google API Hello World
- linux下使用samba上传文件夹和映射samba目录为windows下的目录以及使用source insight查看Linux工程的问题
- DataTable的简单应用
- LCD12864驱动程序---显示日期--时间--图片--反选--
- [转]Ultra Fractal教程系列52——完结——最后的一些思考
- 版本核对很重要
- 增加 删除 更新的 IBATIS SQL
- android自带拍照软件调用
- 深入研究java.lang.ThreadLocal类