當前位置: 首頁>>代碼示例>>Java>>正文


Java GoogleApiClient.ConnectionCallbacks方法代碼示例

本文整理匯總了Java中com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks方法的典型用法代碼示例。如果您正苦於以下問題:Java GoogleApiClient.ConnectionCallbacks方法的具體用法?Java GoogleApiClient.ConnectionCallbacks怎麽用?Java GoogleApiClient.ConnectionCallbacks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.android.gms.common.api.GoogleApiClient的用法示例。


在下文中一共展示了GoogleApiClient.ConnectionCallbacks方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createGoogleClient

import com.google.android.gms.common.api.GoogleApiClient; //導入方法依賴的package包/類
@Override
public void createGoogleClient(GoogleApiClient.ConnectionCallbacks connectionCallbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) {
    googleApiClient = new GoogleApiClient.Builder(getContext())
            .addApi(LocationServices.API)
            .addConnectionCallbacks(connectionCallbacks)
            .addOnConnectionFailedListener(connectionFailedListener)
            .build();
}
 
開發者ID:MohamedNagyMostafa,項目名稱:IM_Here,代碼行數:9,代碼來源:UserProfileFragment.java

示例2: createGoogleClient

import com.google.android.gms.common.api.GoogleApiClient; //導入方法依賴的package包/類
@Override
public void createGoogleClient(GoogleApiClient.ConnectionCallbacks connectionCallbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) {
    googleApiClient = new GoogleApiClient.Builder(getContext())
            .addOnConnectionFailedListener(connectionFailedListener)
            .addConnectionCallbacks(connectionCallbacks)
            .addApi(LocationServices.API)
            .build();
}
 
開發者ID:MohamedNagyMostafa,項目名稱:IM_Here,代碼行數:9,代碼來源:MapActivityFragment.java

示例3: SafetyNetUtils

import com.google.android.gms.common.api.GoogleApiClient; //導入方法依賴的package包/類
public SafetyNetUtils(Context ctx, Callback callback) {
    this.ctx = ctx;
    this.callback = callback;

    GoogleApiClient.OnConnectionFailedListener googleApiConnectionFailedListener = connectionResult -> Log.e(TAG, "onConnectionFailed:" + connectionResult.toString());
    GoogleApiClient.ConnectionCallbacks googleApiConnectionCallbacks = new GoogleApiClient.ConnectionCallbacks() {
        @Override
        public void onConnected(@Nullable Bundle bundle) {
            String logs = bundle == null ? "" : bundle.toString();
            callback.onResponse("GoogleApiClient onConnected " + logs);
        }

        @Override
        public void onConnectionSuspended(int i) {
            Log.d(TAG, "onConnectionSuspended" + i);
        }
    };


    Handler handler = new Handler(MyApplication.INSTANCE.safetyNetLooper.getLooper());
    googleApiClient = new GoogleApiClient.Builder(ctx)
            .addApi(SafetyNet.API)
            .addConnectionCallbacks(googleApiConnectionCallbacks)
            .addOnConnectionFailedListener(googleApiConnectionFailedListener)
            .setHandler(handler) //Run on a new thread
            .build();
    googleApiClient.connect();
    secureRandom = new SecureRandom();
}
 
開發者ID:Catherine22,項目名稱:SecuritySample,代碼行數:30,代碼來源:SafetyNetUtils.java

示例4: from

import com.google.android.gms.common.api.GoogleApiClient; //導入方法依賴的package包/類
/**
 * Initializes the synchronizer.
 * @param context the activity context
 * @param listener the connection callbacks listener
 */
public static UARTConfigurationSynchronizer from(final Context context, final GoogleApiClient.ConnectionCallbacks listener) {
	if (mInstance == null)
		mInstance = new UARTConfigurationSynchronizer();

	mInstance.init(context, listener);
	return mInstance;
}
 
開發者ID:runtimeco,項目名稱:Android-DFU-App,代碼行數:13,代碼來源:UARTConfigurationSynchronizer.java

示例5: init

import com.google.android.gms.common.api.GoogleApiClient; //導入方法依賴的package包/類
private void init(final Context context, final GoogleApiClient.ConnectionCallbacks listener) {
	if (mGoogleApiClient != null)
		return;

	mGoogleApiClient = new GoogleApiClient.Builder(context)
			.addApi(Wearable.API)
			.addConnectionCallbacks(listener)
			.build();
	mGoogleApiClient.connect();
}
 
開發者ID:runtimeco,項目名稱:Android-DFU-App,代碼行數:11,代碼來源:UARTConfigurationSynchronizer.java

示例6: createGoogleClient

import com.google.android.gms.common.api.GoogleApiClient; //導入方法依賴的package包/類
void createGoogleClient(GoogleApiClient.ConnectionCallbacks connectionCallbacks,
GoogleApiClient.OnConnectionFailedListener connectionFailedListener);
 
開發者ID:MohamedNagyMostafa,項目名稱:IM_Here,代碼行數:3,代碼來源:UserLocationCallback.java


注:本文中的com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。