This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once __DIR__.'/../../config.php'; | |
require_once __DIR__.'/../vendor/autoload.php'; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpFoundation\Response; | |
use Silex\Application; | |
$app = new Application(); | |
$client = new Google_Client(); | |
$client->setApplicationName("PHP Quiz"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mGoogleApiClient = new GoogleApiClient.Builder(this) | |
.addApi(Plus.API) | |
.addScope(Plus.SCOPE_PLUS_LOGIN) | |
.addConnectionCallbacks(this) | |
.addOnConnectionFailedListener(this) | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onStart() { | |
super.onStart(); | |
mGoogleApiClient.connect(); | |
} | |
@Override | |
protected void onStop() { | |
mGoogleApiClient.disconnect(); | |
super.onStop(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mPeopleResult = Plus.PeopleApi.loadVisible(mGoogleApiClient, People.OrderBy.BEST, null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mPeopleResult.setResultCallback(this); | |
@Override | |
public void onResult(People.LoadPeopleResult loadPeopleResult) { | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Plus.PlusOptions options = new Plus.PlusOptions.Builder() | |
.addActivityTypes("http://schemas.google.com/AddActivity", | |
"http://schemas.google.com/ReviewActivity") | |
.build(); | |
mGoogleApiClient = new GoogleApiClient.Builder(this) | |
.addApi(Plus.API, options) | |
.addScope(Plus.SCOPE_PLUS_LOGIN) | |
.addConnectionCallbacks(this) | |
.addOnConnectionFailedListener(this) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ItemScope target = new ItemScope.Builder() | |
.setUrl("https://developers.google.com/+/web/snippet/examples/thing") | |
.build(); | |
Moment moment = new Moment.Builder() | |
.setType("http://schemas.google.com/AddActivity") | |
.setTarget(target) | |
.build(); | |
Plus.MomentsApi.write(mGoogleApiClient, moment); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void onClick(View v) { | |
Plus.AccountApi.clearDefaultAccount(mGoogleApiClient); | |
Plus.AccountApi | |
.revokeAccessAndDisconnect(mGoogleApiClient) | |
.setResultCallback(new ResultCallback<Status>() { | |
@Override | |
public void onResult(Status status) { | |
Log.d(TAG, "Disconnected"); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new GoogleApiClient.Builder(this) | |
.addApi(Drive.API) | |
.addScope(Drive.SCOPE_FILE) | |
.addApi(Plus.API, plusOptions) | |
.addScope(Plus.SCOPE_PLUS_LOGIN) | |
.addConnectionCallbacks(this) | |
.addOnConnectionFailedListener(this) | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Quiz; | |
use Symfony\Component\HttpFoundation\Request; | |
class Question { | |
public $questionid; | |
public $starttime; | |
public $questiontext; |
OlderNewer