How to view the Friends in google plus using java-google api? -



How to view the Friends in google plus using java-google api? -

i developing application view google plus friendlist of particular user. far have completed auth process.

my java code

bundle hello; import java.io.ioexception; import javax.servlet.servletexception; import javax.servlet.annotation.webservlet; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; import org.springframework.social.oauth2.granttype; import org.springframework.social.oauth2.oauth2parameters; import com.google.api.client.http.httptransport; import com.google.api.client.http.javanet.nethttptransport; import com.google.api.client.json.jsonfactory; import com.google.api.client.json.jackson.jacksonfactory; import com.googlecode.googleplus.googleplusfactory; /** * servlet implementation class signin */ @webservlet("/signin") public class signin extends httpservlet { private static final long serialversionuid = 1l; /** * @see httpservlet#httpservlet() */ public signin() { super(); // todo auto-generated constructor stub } /** * @see httpservlet#doget(httpservletrequest request, httpservletresponse response) */ protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { googleplusfactory mill = new googleplusfactory("130186078654-sbrvrv50n3hmcd9man1id3r3ptn8e886.apps.googleusercontent.com", "tm857uhpp68g6a12fddubiw-"); oauth2parameters oauthparams = new oauth2parameters(); oauthparams.setredirecturi("http://google.com"); oauthparams.setscope("https://www.googleapis.com/auth/contacts.readonly"); string url = factory.getoauthoperations() .buildauthenticateurl(granttype.authorization_code, oauthparams); response.sendredirect(url); //accessgrant accessgrant = factory.getoauthoperations().exchangeforaccess(code, oauthparams.getredirecturi(), null); // todo auto-generated method stub } /** * @see httpservlet#dopost(httpservletrequest request, httpservletresponse response) */ protected void dopost(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { // todo auto-generated method stub } }

how can user friends after completing oauth process?

java google-plus

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -