你可以嘗試的官方文件 - Overview of Google Play Services
隨着谷歌播放服務,您的應用程序可以利用最新的,谷歌驅動的功能,如地圖,Google +等,具有自動平臺更新分佈式作爲APK通過Google Play商店。這可讓您的用戶更快獲得更新,並且更容易整合Google提供的最新版本。
顯示谷歌API客戶端如何提供連接和撥打電話到任何可用的谷歌Play服務,如谷歌玩遊戲和谷歌驅動器的接口一個例證。
要開始使用,您必須先爲Android SDK安裝Google Play服務庫(修訂版15或更高版本)。如果您還沒有這樣做,請按照設置Google Play服務SDK中的說明操作。
下面是實現回調接口,並將它們添加到谷歌API客戶端的活動代碼示例:
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import gms.drive.*;
import android.support.v4.app.FragmentActivity;
public class MyActivity extends FragmentActivity
implements OnConnectionFailedListener {
private GoogleApiClient mGoogleApiClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create a GoogleApiClient instance
mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this /* FragmentActivity */,
this /* OnConnectionFailedListener */)
.addApi(Drive.API)
.addScope(Drive.SCOPE_FILE)
.build();
// ...
}
@Override
public void onConnectionFailed(ConnectionResult result) {
// An unresolvable error has occurred and a connection to Google APIs
// could not be established. Display an error message, or handle
// the failure silently
// ...
}
}
我知道如何使用谷歌播放服務,但所有這些文件是在告訴只要。但一些人傾向於瞭解他們如何實施谷歌播放服務的內部細節。他們使用了什麼數據結構。他們考慮什麼設計考慮等等 – user2885066