I wrote a program for Android. In the Google Play console, I have enabled Google Play services. In the program I want to connect to them. In the Google Play Developer console I have added my accounts to the test. Services GooglePlay are published. Unfortunately, I can't connect to Google Play service. I always get the message "No connection". Is there something wrong in my program, or I set something wrong in the Google Play console? I append fragment of "manifest.xml", activity text and a screenshots of Google console.
Please help me! I did everything according to the description on Google Play, but from two weeks I can not find a solution.
Regards, gravedg
Fragment of file "Manifest.xml":
<meta-data android:name="com.google.android.gms.games.APP_ID" (my app ID is here) android:value="@string/app_id" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
Fragment of file "Test1Activity.java":
package pl.(... here is my package name ...);
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks;
import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener;
import com.google.android.gms.games.Games;
import com.google.android.gms.plus.Plus;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;
topublic class Test1Activity extends AppCompatActivity
implements ConnectionCallbacks, OnConnectionFailedListener {
private GoogleApiClient mGoogleApiClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Plus.API)
.addScope(Plus.SCOPE_PLUS_LOGIN)
.addApi(Games.API)
.addScope(Games.SCOPE_GAMES)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
}
@Override
protected void onStart() {
super.onStart();
mGoogleApiClient.connect();
}
@Override
protected void onStop() {
mGoogleApiClient.disconnect();
super.onStop();
}
@Override
public void onConnected(Bundle connectionHint) {
Toast.makeText(getApplicationContext(), "Connection OK", Toast.LENGTH_LONG).show();
}
@Override
public void onConnectionSuspended(int cause) {
Toast.makeText(getApplicationContext(), "Connection Suspended", Toast.LENGTH_LONG).show();
}
@Override
public void onConnectionFailed(ConnectionResult result) {
Toast.makeText(getApplicationContext(), "No connection", Toast.LENGTH_LONG).show();
}