[Homeros] I: Библиотека для Google API на Java

Michael Pozhidaev msp на altlinux.ru
Пн Сен 19 22:22:56 UTC 2011


Привет всем!

События в Google продолжают развиваться в весьма удачном для нас
направлении, по крайней мере, в таком виде, как это можно сейчас
наблюдать. Представлена обновление библиотеки на Java, которая даёт доступ к
службам Google без использования браузера. В частности, принципиальное
отличие от библиотеки googlecl, представленной ранее, в том, что в новом
виде, похоже, возможна аутентификация без использования браузера.

Для массового пользователя текущая заметка, наверно, пока не очень
полезна, но это даёт шанс рано или поздно получить ряд инструментов,
которые позволят пользоваться службами Google без браузера и в emacs.

Главная ссылка на проект:

http://code.google.com/p/google-api-java-client/

Сама заметка, но на английском:

Google APIs Client Library for Java: now with OAuth 2.0
http://feedproxy.google.com/~r/blogspot/Dcni/~3/svgix3L-hB8/google-apis-client-library-for-java-now.html
	at 19-09-2011 15:00:00

   During [0] Google I/O 2011, we announced a major milestone by
   releasing the Beta version of the open source [1] Google APIs Client
   Library for Java. This release included [2] service-specific libraries
   and samples for Google APIs, built on our [3] new client library
   generation infrastructure. Since that version 1.4 launch, we’ve been
   comfortable enough with the stability and features of the library that
   we want you to [4] start building real production Java 5, [5] Android,
   and [6] Google App Engine applications and [7] send us your feedback.

   Today we are announcing a new milestone for the Java client library.
   With the version 1.5 release, we’re making available the open source
   [8] Google OAuth Client Library for Java in Beta, with support for
   both [9] OAuth 1.0a and [10] OAuth 2.0. OAuth is an open standard for
   allowing a client application to securely gain access to a user’s
   private data stored on Google without ever asking for their password.
   Most Google APIs support OAuth 2.0, and we want to encourage adoption
   of OAuth 2.0 more widely on the web. That’s why we built this library
   to work with any API on the web -- not just Google APIs -- that comply
   with the OAuth specifications. Our current implementation of OAuth 2.0
   is based on [11] draft 10, but we will update it soon to the final
   draft, once it becomes an official standard. We encourage you to [12] try
   it and [13] send us your feedback.

   Here is an example of how easy it is to use the OAuth 2.0 library to
   make a request using the library for the [14] Google+ API (check out
   [15] more samples):

   // Set up the HTTP transport and JSON factory         HttpTransport    httpTransport =    new       NetHttpTransport   ();   JsonFactory    jsonFactory =    new       JacksonFactory   ();
   // Set up OAuth 2.0 access of protected resources 
   // using the refresh and access tokens, automatically 
   // refreshing the access token when it expires      GoogleAccessProtectedResource    requestInitializer =        new       GoogleAccessProtectedResource   (accessToken, httpTransport, 
       jsonFactory, clientId, clientSecret, refreshToken);
   // Set up the main Google+ class      Plus    plus =    new       Plus   (httpTransport, requestInitializer, jsonFactory);
   // Make a request to access your profile and display it to console      Person    profile = plus.people().   get   (   "me"   ).execute();   System   .   out   .println(   "ID: "    + profile.getId());   System   .   out   .println(   "Name: "    + profile.getDisplayName());   System   .   out   .println(   "Image URL: "    + profile.getImage().getUrl());   System   .   out   .println(   "Profile URL: "    + profile.getUrl());

   Finally, we are making available a Beta version of the open source
   [16] Google HTTP Client Library for Java. This is the common HTTP
   client library that the above two libraries are built on, and is built
   to work with any API on the web. It features a pluggable HTTP
   transport abstraction that allows it to work seamlessly on any of the
   supported Java platforms, support for efficient JSON and XML data
   models for parsing and serialization, and a pluggable JSON and XML
   parser so you can use whatever works best for you. Please [17] try it
   and [18] send us your feedback.

   We are looking forward to finding out what you can build using these
   libraries on Google APIs. Please let us know how we can make the
   libraries easier to use and better suited for your needs.

   /As we [19] announced at Google I/O 2010, we've been developing APIs
   that can provide [20] descriptions of themselves via metadata. This
   new technique makes it easier to create and maintain client libraries
   that support more languages, work with more APIs, and are easier to
   use than ever before. This post announces one of several recent major
   milestones for our client libraries./


   /[21] Yaniv Inbar is a Senior Software Engineer and Technical Lead of
   the Google APIs Client Libraries & Tools team. He is the lead
   developer of the open source Google APIs Client Library for Java.
   Yaniv has worked at Google for 5 years, and has a total of 12 years
   industry experience as a software engineer./

   /Posted by [22] Scott Knaster, Editor/

   [23] [IMAGE] [24] [IMAGE] [25] [IMAGE][IMAGE]

   [0] http://www.google.com/events/io/2011/sessions/best-practices-for-accessing-google-apis-on-android.html
   [1] http://code.google.com/p/google-api-java-client/
   [2] http://code.google.com/p/google-api-java-client/wiki/APILibraries
   [3] http://www.google.com/events/io/2011/sessions/building-custom-client-libraries-for-google-apis.html
   [4] http://code.google.com/p/google-api-java-client/wiki/DeveloperGuide
   [5] http://code.google.com/p/google-api-java-client/wiki/Android
   [6] http://code.google.com/p/google-api-java-client/wiki/GoogleAppEngine
   [7] https://groups.google.com/group/google-api-java-client
   [8] http://code.google.com/p/google-oauth-java-client/
   [9] http://tools.ietf.org/html/rfc5849
   [10] http://tools.ietf.org/html/draft-ietf-oauth-v2
   [11] http://tools.ietf.org/html/draft-ietf-oauth-v2-10
   [12] http://code.google.com/p/google-oauth-java-client/wiki/DeveloperGuide
   [13] https://groups.google.com/forum/#!forum/google-oauth-java-client
   [14] http://developers.google.com/+/
   [15] http://code.google.com/p/google-plus-java-starter/
   [16] http://code.google.com/p/google-http-java-client/
   [17] http://code.google.com/p/google-http-java-client/wiki/DeveloperGuide
   [18] https://groups.google.com/forum/#!forum/google-http-java-client
   [19] http://www.youtube.com/watch?v=nyu5ZxGUfgs
   [20] http://code.google.com/apis/discovery/
   [21] https://plus.google.com/115186671970087006570/about
   [22] https://profiles.google.com/u/0/105627346610764729807/about
   [23] http://feeds.feedburner.com/~ff/blogspot/Dcni?a=svgix3L-hB8:o8tSPbltDTs:-BTjWOF_DHI
   [24] http://feeds.feedburner.com/~ff/blogspot/Dcni?a=svgix3L-hB8:o8tSPbltDTs:yIl2AUoC8zA
   [25] http://feeds.feedburner.com/~ff/blogspot/Dcni?a=svgix3L-hB8:o8tSPbltDTs:V_sGLiPBpWU

-- 
Michael Pozhidaev. Tomsk, Russia.
Russian info page: http://www.marigostra.ru/


Подробная информация о списке рассылки Homeros